home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / mus / midi / XGToolset5_src.lha / XGToolset_src / XGVarFX / XGVarFX.c < prev    next >
C/C++ Source or Header  |  1999-02-18  |  123KB  |  3,042 lines

  1. /*
  2.     XG-VariationFX-Editor V1.4
  3.  
  4.     A  Bars  and  Pipes  tool  for  editing  the  DB50-XG-board  from  YAMAHA.
  5.     Especially the VariationFX-effects with all parameters.
  6.  
  7.     Use it together with the XGMain.ptool form us.
  8.  
  9.     © 1998 Alfred & Matthias Faust (father & son)
  10.  
  11.     The Tool-code based farly on the code for  the  "pc3.ptool"  from  Richard
  12.     Hagen. That's a very good tool, many thanks to him.
  13.  
  14.     Richard has written his tool with DICE. We altered  the  code  to  compile
  15.     with  the  free  GNU-C-compiler  of  the  ADE.  Especially  the  part  was
  16.     transcripted,  that  place  the  imagedate  in   chip-RAM,   because   the
  17.     GNU-C-compiler  hasn't  as  yet  a keyword like DICE or other compiler for
  18.     this.
  19.  
  20.     This  code  is  released  into  the  Public  Domain,  and  may  be  freely
  21.     distributed in its original form.
  22.  
  23.     It is supplied ``as is'', and comes with no warranty.  This  program  code
  24.     was  released  because  it  might  be useful as a starting point for other
  25.     programmers. However, if any damage arises  from  its  use,  the  original
  26.     author and we will not be held liable.
  27.  
  28.     You are free to use and modify this code to your heart's content, provided
  29.     you  acknowledge  me  as  the  original  author in any code that you might
  30.     distribute which is based largely on this code.
  31.  
  32.     I acknowledge that the design of this tool is influenced strongly  by  the
  33.     example  code  supplied  with the Rules for Tools package. However, I have
  34.     made substantial contributions of my own.
  35.  
  36.     Matthias & Alfred Faust
  37.     j.k.dax@t-online.de
  38.  
  39.     History:
  40.         1.0 - 1.2
  41.         overjumping, because all tools shall have the same version number
  42.  
  43.         1.3 (26.11.1998)
  44.         Initial Release.
  45.  
  46.         1.4 (18.2.1999)
  47.         all slidervalues will be "remembered" if tool is placed in the
  48.         pipeline and stored with the song, reloaded and worked away.
  49.     
  50. */
  51.  
  52. #include "bars.h"
  53. #include "myheader.h"  // from R.Hagen
  54. #include <libraries/dos.h>
  55. #include <proto/exec.h>
  56. #include <proto/intuition.h>
  57. #include <proto/graphics.h>
  58. #include <exec/memory.h>
  59. #include <exec/execbase.h>
  60. #include <exec/types.h>
  61. #include <string.h>
  62. #include <intuition/intuition.h>
  63.  
  64.  
  65. char version[]="\0$VER:XG-VarFX-Edit 1.4 (18.02.98) © Alfred & Matthias Faust";
  66.  
  67. #define VXXG_NAME "XG-VarFX-Edit"
  68.  
  69. #define VXXG_ID          0x56585847
  70. #define VXXG_TYPE        (TOOL_NORMAL | TOOL_NOTPAD)
  71.  
  72. // Variations-Effects
  73.  
  74. #define hall1             0
  75. #define hall2             1
  76. #define room1             2
  77. #define room2             3
  78. #define room3             4
  79. #define stage1            5
  80. #define stage2            6
  81. #define plate             7
  82. #define delaylcr          8
  83. #define delaylr           9
  84. #define echo             10
  85. #define crossdelay       11
  86. #define earlyrefl1       12
  87. #define earlyrefl2       13
  88. #define gatereverb       14
  89. #define reversegate      15
  90. #define karaoke1         16
  91. #define karaoke2         17
  92. #define karaoke3         18
  93. #define chorus1          19
  94. #define chorus2          20
  95. #define chorus3          21
  96. #define chorus4          22
  97. #define celeste1         23
  98. #define celeste2         24
  99. #define celeste3         25
  100. #define celeste4         26
  101. #define flanger1         27
  102. #define flanger2         28
  103. #define flanger3         29
  104. #define symphonic        30
  105. #define rotaryspeaker    31
  106. #define tremolo          32
  107. #define autopan          33
  108. #define phaser1          34
  109. #define phaser2          35
  110. #define distortion       36
  111. #define overdrive        37
  112. #define guitaramp        38
  113. #define autowah          39
  114. #define monoeq           40
  115. #define stereoeq         41
  116.  
  117. char typehexstr[42][4]={
  118. "0100","0101","0200","0201","0202", // hall1+2,room1-3
  119. "0300","0301","0400",               // stage1+2, plate
  120. "0500","0600","0700","0800",        // delayLCR, delayLR, echo, cross delay
  121. "0900","0901",                      // early reflection 1+2
  122. "0a00","0b00",                      // gate reverse, reverse gate
  123. "1400","1401","1402",               // karaoke 1-3
  124. "4100","4101","4102","4108",        // chorus 1-4
  125. "4200","4201","4202","4208",        // celeste 1-4
  126. "4300","4301","4308",               // flanger 1-3
  127. "4400","4500","4600","4700",        // symphonic, rotary speaker, tremolo, auto pan
  128. "4800","4808",                      // phaser 1+2
  129. "4900","4a00",                      // disortion, overdrive
  130. "4b00","4e00",                      // guitar amp, auto wah
  131. "4c00","4d00"                       // 3-band-equalizer(mono), 2-band-equalizer(stereo)
  132. };
  133.  
  134.  
  135. extern struct ExecBase * SysBase;
  136.  
  137. /* the litte Icon in the pipeline */
  138.  
  139. UWORD *VXXG=NULL;
  140.  
  141. static UWORD VXXGdata[] =
  142. {
  143.         /* Plane 0 */
  144.                 0x7FFF,0xFE00,
  145.                 0x7FFF,0xFE00,
  146.                 0x7FFF,0xFE00,
  147.                 0x7DDF,0x7600,
  148.                 0x796B,0xAE00,
  149.                 0x61DE,0xDE00,
  150.                 0x61BB,0xDE00,
  151.                 0x79FB,0xAE00,
  152.                 0x7DBB,0x7600,
  153.                 0x7FFF,0xFE00,
  154.                 0x7FFF,0xFE00,
  155.                 0x7FFF,0xFE00,
  156.         /* Plane 1 */
  157.                 0x0000,0x0200,
  158.                 0x0000,0x0600,
  159.                 0x1FFF,0xFE00,
  160.                 0x1F30,0x6600,
  161.                 0x9ED3,0x0F00,
  162.                 0x87B0,0x9F00,
  163.                 0x8773,0x9F00,
  164.                 0x9FF3,0x0F00,
  165.                 0x1F72,0x6600,
  166.                 0x1FFF,0xFE00,
  167.                 0x1FFF,0xFE00,
  168.                 0x3FFF,0xFE00,
  169.         /* Plane 2 */
  170.                 0x0000,0x0000,
  171.                 0x0000,0x0000,
  172.                 0x1FFF,0xF800,
  173.                 0x1FDF,0xF800,
  174.                 0x1F6F,0xF800,
  175.                 0x1FDF,0xF800,
  176.                 0x1FBF,0xF800,
  177.                 0x1FFF,0xF800,
  178.                 0x1FBF,0xF800,
  179.                 0x1FFF,0xF800,
  180.                 0x0000,0x0000,
  181.                 0x0000,0x0000
  182. };
  183.  
  184. static struct Image VXXG_image = {
  185.   0, 0,
  186.   24 ,  12 ,  3 ,
  187.   NULL,
  188.   0x1f, 0x00,
  189.   NULL
  190. };
  191.  
  192.  
  193. //Definitions of the gadgets
  194.  
  195.  
  196. #define VXTYPE_GADGET            1
  197. #define VXTYPEDOWN_GADGET        2
  198. #define VXTYPEUP_GADGET          3
  199.  
  200. #define VXONE_GADGET             4
  201. #define VXONEDOWN_GADGET         5
  202. #define VXONEUP_GADGET           6
  203.  
  204. #define VXTWO_GADGET             7
  205. #define VXTWODOWN_GADGET         8
  206. #define VXTWOUP_GADGET           9
  207.  
  208. #define VXTHREE_GADGET          10
  209. #define VXTHREEDOWN_GADGET      11
  210. #define VXTHREEUP_GADGET        12
  211.  
  212. #define VXFOUR_GADGET           13
  213. #define VXFOURDOWN_GADGET       14
  214. #define VXFOURUP_GADGET         15
  215.  
  216. #define VXFIVE_GADGET           16
  217. #define VXFIVEDOWN_GADGET       17
  218. #define VXFIVEUP_GADGET         18
  219.  
  220. #define VXSIX_GADGET            19
  221. #define VXSIXDOWN_GADGET        20
  222. #define VXSIXUP_GADGET          21
  223.  
  224. #define VXSEVEN_GADGET          22
  225. #define VXSEVENDOWN_GADGET      23
  226. #define VXSEVENUP_GADGET        24
  227.  
  228. #define VXEIGHT_GADGET          25
  229. #define VXEIGHTDOWN_GADGET      26
  230. #define VXEIGHTUP_GADGET        27
  231.  
  232. #define VXNINE_GADGET           28
  233. #define VXNINEDOWN_GADGET       29
  234. #define VXNINEUP_GADGET         30
  235.  
  236. #define VXTEN_GADGET            31
  237. #define VXTENDOWN_GADGET        32
  238. #define VXTENUP_GADGET          33
  239.  
  240. #define VXELEVEN_GADGET         34
  241. #define VXELEVENDOWN_GADGET     35
  242. #define VXELEVENUP_GADGET       36
  243.  
  244. #define VXTWELVE_GADGET         37
  245. #define VXTWELVEDOWN_GADGET     38
  246. #define VXTWELVEUP_GADGET       39
  247.  
  248. #define VXTHIRTEEN_GADGET       40
  249. #define VXTHIRTEENDOWN_GADGET   41
  250. #define VXTHIRTEENUP_GADGET     42
  251.  
  252. #define VXFOURTEEN_GADGET       43
  253. #define VXFOURTEENDOWN_GADGET   44
  254. #define VXFOURTEENUP_GADGET     45
  255.  
  256. #define VXFIFTEEN_GADGET        46
  257. #define VXFIFTEENDOWN_GADGET    47
  258. #define VXFIFTEENUP_GADGET      48
  259.  
  260. #define VXSIXTEEN_GADGET        49
  261. #define VXSIXTEENDOWN_GADGET    50
  262. #define VXSIXTEENUP_GADGET      51
  263.  
  264. #define VXSEVENTEEN_GADGET      52
  265. #define VXSEVENTEENDOWN_GADGET  53
  266. #define VXSEVENTEENUP_GADGET    54
  267.  
  268. #define VXEIGHTEEN_GADGET      55
  269. #define VXEIGHTEENDOWN_GADGET  56
  270. #define VXEIGHTEENUP_GADGET    57
  271.  
  272. #define VXNINETEEN_GADGET       58
  273. #define VXNINETEENDOWN_GADGET   59
  274. #define VXNINETEENUP_GADGET     60
  275.  
  276. #define VXTWENTY_GADGET         61
  277. #define VXTWENTYDOWN_GADGET     62
  278. #define VXTWENTYUP_GADGET       63
  279.  
  280. #define VXTWENTYONE_GADGET      64
  281. #define VXTWENTYONEDOWN_GADGET  65
  282. #define VXTWENTYONEUP_GADGET    66
  283.  
  284. #define WRITE_GADGET             67
  285.  
  286. //all the gadgets
  287.  
  288. /* VariationFX-Type-Gadget */
  289. struct PropInfo VXXGGadget1SInfo = {
  290.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  291. };
  292.  
  293. struct Image VXXGImage1 = {
  294.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  295. };
  296.  
  297. struct IntuiText VXXGIText1 = {
  298.   2, 0, JAM1, -78, 1, NULL, "VarFXType", NULL
  299. };
  300.  
  301. struct Gadget VXXGGadget1 = {
  302.   NULL, 85, 31, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  303.   (APTR)&VXXGImage1, NULL, &VXXGIText1, NULL, (APTR)&VXXGGadget1SInfo, VXTYPE_GADGET, NULL
  304. };
  305.  
  306.  
  307. /* VariationFX-one-Gadget */
  308. struct PropInfo VXXGGadget2SInfo = {
  309.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  310. };
  311.  
  312. struct Image VXXGImage2 = {
  313.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  314. };
  315. struct Gadget VXXGGadget2 = {
  316.   &VXXGGadget1, 85, 42, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  317.   (APTR)&VXXGImage2, NULL, NULL, NULL, (APTR)&VXXGGadget2SInfo, VXONE_GADGET, NULL
  318. };
  319.  
  320.  
  321. /* VariationFX-two-Gadget */
  322. struct PropInfo VXXGGadget3SInfo = {
  323.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  324. };
  325.  
  326. struct Image VXXGImage3 = {
  327.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  328. };
  329.  
  330. struct Gadget VXXGGadget3 = {
  331.   &VXXGGadget2, 85, 53, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  332.   (APTR)&VXXGImage3, NULL, NULL, NULL, (APTR)&VXXGGadget3SInfo, VXTWO_GADGET, NULL
  333. };
  334.  
  335. //VariationFX-three-Gadget
  336. struct PropInfo VXXGGadget4SInfo = {
  337.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  338. };
  339.  
  340. struct Image VXXGImage4 = {
  341.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  342. };
  343.  
  344. struct Gadget VXXGGadget4 = {
  345.   &VXXGGadget3, 85, 64, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  346.   (APTR)&VXXGImage4, NULL, NULL, NULL, (APTR)&VXXGGadget4SInfo, VXTHREE_GADGET, NULL
  347. }; //  VXTHREE_GADGET
  348.  
  349. //VariationFX-four-Gadget
  350. struct PropInfo VXXGGadget5SInfo = {
  351.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  352. };
  353.  
  354. struct Image VXXGImage5 = {
  355.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  356. };
  357.  
  358. struct Gadget VXXGGadget5 = {
  359.   &VXXGGadget4, 85, 75, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  360.   (APTR)&VXXGImage5, NULL, NULL, NULL, (APTR)&VXXGGadget5SInfo, VXFOUR_GADGET, NULL
  361. }; //VXFOUR_GADGET
  362.  
  363.  
  364. //VariationFX-five-Gadget
  365. struct PropInfo VXXGGadget6SInfo = {
  366.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  367. };
  368.  
  369. struct Image VXXGImage6 = {
  370.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  371. };
  372.  
  373. struct Gadget VXXGGadget6 = {
  374.   &VXXGGadget5, 85, 86, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  375.   (APTR)&VXXGImage6, NULL, NULL, NULL, (APTR)&VXXGGadget6SInfo, VXFIVE_GADGET, NULL
  376. }; //VXFIVE_GADGET
  377.  
  378. //VariationFX-six-Gadget
  379. struct PropInfo VXXGGadget7SInfo = {
  380.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  381. };
  382.  
  383. struct Image VXXGImage7 = {
  384.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  385. };
  386.  
  387. struct Gadget VXXGGadget7 = {
  388.   &VXXGGadget6, 85, 97, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  389.   (APTR)&VXXGImage7, NULL, NULL, NULL, (APTR)&VXXGGadget7SInfo, VXSIX_GADGET, NULL
  390. }; //VXSIX_GADGET
  391.  
  392. //VariationFX-seven-Gadget
  393. struct PropInfo VXXGGadget8SInfo = {
  394.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  395. };
  396.  
  397. struct Image VXXGImage8 = {
  398.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  399. };
  400.  
  401. struct Gadget VXXGGadget8 = {
  402.   &VXXGGadget7, 85, 108, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  403.   (APTR)&VXXGImage8, NULL, NULL, NULL, (APTR)&VXXGGadget8SInfo, VXSEVEN_GADGET, NULL
  404. }; //VXSEVEN_GADGET
  405.  
  406.  
  407. //VariationFX-eight-Gadget
  408. struct PropInfo VXXGGadget9SInfo = {
  409.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  410. };
  411.  
  412. struct Image VXXGImage9 = {
  413.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  414. };
  415.  
  416. struct Gadget VXXGGadget9 = {
  417.   &VXXGGadget8, 85, 119, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  418.   (APTR)&VXXGImage9, NULL, NULL, NULL, (APTR)&VXXGGadget9SInfo, VXEIGHT_GADGET, NULL
  419. }; //VXEIGHT_GADGET
  420.  
  421.  
  422. //VariationFX-nine-Gadget
  423. struct PropInfo VXXGGadget10SInfo = {
  424.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  425. };
  426.  
  427. struct Image VXXGImage10 = {
  428.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  429. };
  430.  
  431. struct Gadget VXXGGadget10 = {
  432.   &VXXGGadget9, 85, 130, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  433.   (APTR)&VXXGImage10, NULL, NULL, NULL, (APTR)&VXXGGadget10SInfo, VXNINE_GADGET, NULL
  434. }; //VXNINE_GADGET
  435.  
  436. //VariationFX-ten-Gadget
  437. struct PropInfo VXXGGadget11SInfo = {
  438.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  439. };
  440.  
  441. struct Image VXXGImage11 = {
  442.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  443. };
  444.  
  445. struct Gadget VXXGGadget11 = {
  446.   &VXXGGadget10, 85, 141, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  447.   (APTR)&VXXGImage11, NULL, NULL, NULL, (APTR)&VXXGGadget11SInfo, VXTEN_GADGET, NULL
  448. }; //VXTEN_GADGET
  449.  
  450. //VariationFX-eleven-Gadget
  451. struct PropInfo VXXGGadget12SInfo = {
  452.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  453. };
  454.  
  455. struct Image VXXGImage12 = {
  456.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  457. };
  458.  
  459. struct Gadget VXXGGadget12 = {
  460.   &VXXGGadget11, 85, 152, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  461.   (APTR)&VXXGImage12, NULL, NULL, NULL, (APTR)&VXXGGadget12SInfo, VXELEVEN_GADGET, NULL
  462. }; //VXELEVEN_GADGET
  463.  
  464. //VariationFX-twelve-Gadget
  465. struct PropInfo VXXGGadget13SInfo = {
  466.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  467. };
  468.  
  469. struct Image VXXGImage13 = {
  470.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  471. };
  472.  
  473. struct Gadget VXXGGadget13 = {
  474.   &VXXGGadget12, 85, 163, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  475.   (APTR)&VXXGImage13, NULL, NULL, NULL, (APTR)&VXXGGadget13SInfo, VXTWELVE_GADGET, NULL
  476. }; //VXTWELVE_GADGET
  477.  
  478.  
  479. //VariationFX-thirteen-Gadget
  480. struct PropInfo VXXGGadget14SInfo = {
  481.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  482. };
  483.  
  484. struct Image VXXGImage14 = {
  485.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  486. };
  487.  
  488. struct Gadget VXXGGadget14 = {
  489.   &VXXGGadget13, 85, 174, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  490.   (APTR)&VXXGImage14, NULL, NULL, NULL, (APTR)&VXXGGadget14SInfo, VXTHIRTEEN_GADGET, NULL
  491. }; //VXTHIRTEEN_GADGET
  492.  
  493. //VariationFX-fourteen-Gadget
  494. struct PropInfo VXXGGadget15SInfo = {
  495.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  496. };
  497.  
  498. struct Image VXXGImage15 = {
  499.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  500. };
  501.  
  502. struct Gadget VXXGGadget15 = {
  503.   &VXXGGadget14, 85, 185, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  504.   (APTR)&VXXGImage15, NULL, NULL, NULL, (APTR)&VXXGGadget15SInfo, VXFOURTEEN_GADGET, NULL
  505. }; //VXFOURTEEN_GADGET
  506.  
  507. //VariationFX-fifteen-Gadget
  508. struct PropInfo VXXGGadget16SInfo = {
  509.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  510. };
  511.  
  512. struct Image VXXGImage16 = {
  513.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  514. };
  515.  
  516. struct Gadget VXXGGadget16 = {
  517.   &VXXGGadget15, 85, 196, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  518.   (APTR)&VXXGImage16, NULL, NULL, NULL, (APTR)&VXXGGadget16SInfo, VXFIFTEEN_GADGET, NULL
  519. }; //VXFIFTEEN_GADGET
  520.  
  521. //VariationFX-sixteen-Gadget
  522. struct PropInfo VXXGGadget17SInfo = {
  523.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  524. };
  525.  
  526. struct Image VXXGImage17 = {
  527.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  528. };
  529.  
  530. struct Gadget VXXGGadget17 = {
  531.   &VXXGGadget16, 85, 207, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  532.   (APTR)&VXXGImage17, NULL, NULL, NULL, (APTR)&VXXGGadget17SInfo, VXSIXTEEN_GADGET, NULL
  533. }; //VXSIXTEEN_GADGET
  534.  
  535. //VariationFX-seventeen-Gadget
  536. struct PropInfo VXXGGadget18SInfo = {
  537.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  538. };
  539.  
  540. struct Image VXXGImage18 = {
  541.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  542. };
  543.  
  544. struct Gadget VXXGGadget18 = {
  545.   &VXXGGadget17, 85, 218, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  546.   (APTR)&VXXGImage18, NULL, NULL, NULL, (APTR)&VXXGGadget18SInfo, VXSEVENTEEN_GADGET, NULL
  547. }; //VXSEVENTEEN_GADGET
  548.  
  549. //VariationFX-eighteen-Gadget
  550. struct PropInfo VXXGGadget19SInfo = {
  551.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  552. };
  553.  
  554. struct Image VXXGImage19 = {
  555.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  556. };
  557.  
  558. struct Gadget VXXGGadget19 = {
  559.   &VXXGGadget18, 85, 229, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  560.   (APTR)&VXXGImage19, NULL, NULL, NULL, (APTR)&VXXGGadget19SInfo, VXEIGHTEEN_GADGET, NULL
  561. }; //VXeighteen_GADGET
  562.  
  563. //VariationFX-nineteen-Gadget
  564. struct PropInfo VXXGGadget20SInfo = {
  565.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  566. };
  567.  
  568. struct Image VXXGImage20 = {
  569.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  570. };
  571.  
  572. struct Gadget VXXGGadget20 = {
  573.   &VXXGGadget19, 85, 240, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  574.   (APTR)&VXXGImage20, NULL, NULL, NULL, (APTR)&VXXGGadget20SInfo, VXNINETEEN_GADGET, NULL
  575. }; //VXNINETEEN_GADGET
  576.  
  577. //VariationFX-twenty-Gadget
  578. struct PropInfo VXXGGadget21SInfo = {
  579.   AUTOKNOB+FREEHORIZ, -16384,  -1, 16384,  -1,
  580. };
  581.  
  582. struct Image VXXGImage21 = {
  583.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL
  584. };
  585.  
  586. struct Gadget VXXGGadget21 = {
  587.   &VXXGGadget20, 85, 251, 150, 9, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  588.   (APTR)&VXXGImage21, NULL, NULL, NULL, (APTR)&VXXGGadget21SInfo, VXTWENTY_GADGET, NULL
  589. }; //VXTWENTY_GADGET
  590.  
  591. /* Test gadget. */
  592. struct IntuiText VXXGIText22 = {
  593.   4,0,JAM1,4,2,NULL,"Write",NULL
  594.   };
  595.  
  596. struct Gadget VXXGGadget22 = {
  597.   &VXXGGadget21,117,269,45,11,GFLG_GADGHBOX|GFLG_GADGHIMAGE,RELVERIFY|GADGIMMEDIATE,BOOLGADGET,
  598.   (APTR)NULL,NULL,&VXXGIText22,NULL,NULL,WRITE_GADGET,NULL
  599.   };
  600.  
  601.  
  602.  
  603. //the mainwindowstructure
  604.  
  605. struct NewWindow VXXGNewWindowStructure1 = {
  606.   5, 167,
  607.   275, 290,
  608.   0, 6,
  609.   GADGETDOWN|GADGETUP|CLOSEWINDOW,
  610.   WINDOWDRAG|WINDOWDEPTH|WINDOWCLOSE|ACTIVATE|NOCAREREFRESH,
  611.   &VXXGGadget22,
  612.   NULL,
  613.   "XGVariationFX-Editor",
  614.   NULL,
  615.   NULL,
  616.   5, 5,
  617.   -1, -1,
  618.   CUSTOMSCREEN
  619. };
  620.  
  621.  
  622. struct VXXGTool {
  623.   struct Tool tool;
  624.  
  625.   UBYTE vrfxtype;
  626.   UBYTE vrfxone;
  627.   UBYTE vrfxtwo;
  628.   UBYTE vrfxthree;
  629.   UBYTE vrfxfour;
  630.   UBYTE vrfxfive;
  631.   UBYTE vrfxsix;
  632.   UBYTE vrfxseven;
  633.   UBYTE vrfxeight;
  634.   UBYTE vrfxnine;
  635.   UBYTE vrfxten;
  636.   UBYTE vrfxeleven;
  637.   UBYTE vrfxtwelve;
  638.   UBYTE vrfxthirteen;
  639.   UBYTE vrfxfourteen;
  640.   UBYTE vrfxfifteen;
  641.   UBYTE vrfxsixteen;
  642.   UBYTE vrfxseventeen;
  643.   UBYTE vrfxeighteen;
  644.   UBYTE vrfxnineteen;
  645.   UBYTE vrfxtwenty;
  646.  
  647.   char *typesysex;
  648.   char *onesysex;
  649.   char *twosysex;
  650.   char *threesysex;
  651.   char *foursysex;
  652.   char *fivesysex;
  653.   char *sixsysex;
  654.   char *sevensysex;
  655.   char *eightsysex;
  656.   char *ninesysex;
  657.   char *tensysex;
  658.   char *elevensysex;
  659.   char *twelvesysex;
  660.   char *thirteensysex;
  661.   char *fourteensysex;
  662.   char *fifteensysex;
  663.   char *sixteensysex;
  664.   char *seventeensysex;
  665.   char *eighteensysex;
  666.   char *nineteensysex;
  667.   char *twentysysex;
  668.  
  669.   char storage1[32];
  670.   char storage2[32];
  671.   char storage3[32];
  672.   char storage4[32];
  673.   char storage5[32];
  674.   char storage6[32];
  675.   char storage7[32];
  676.   char storage8[32];
  677.   char storage9[32];
  678.   char storage10[32];
  679.   char storage11[32];
  680.   char storage12[32];
  681.   char storage13[32];
  682.   char storage14[32];
  683.   char storage15[32];
  684.   char storage16[32];
  685.   char storage17[32];
  686.   char storage18[32];
  687.   char storage19[32];
  688.   char storage20[32];
  689.   char storage21[32];
  690. };
  691.  
  692. int typeval;
  693. static struct ToolMaster master;
  694.  
  695. extern struct Functions *functions;
  696.  
  697. //initial values
  698. static void VXXG_tool_init(struct VXXGTool *tool)
  699. {
  700.  
  701.  
  702.  
  703.   tool->vrfxtype =        0x08;
  704.   tool->vrfxone =         0x1a;
  705.   tool->vrfxtwo =         0x0d;
  706.   tool->vrfxthree =       0x27;
  707.   tool->vrfxfour =        0x27;
  708.   tool->vrfxfive =        0x4a;
  709.   tool->vrfxsix =         0x64;
  710.   tool->vrfxseven =       0x0a;
  711.   tool->vrfxeight =       0x00;
  712.   tool->vrfxnine =        0x00;
  713.   tool->vrfxten =         0x20;
  714.   tool->vrfxeleven =      0x40;
  715.   tool->vrfxtwelve =      0x40;
  716.   tool->vrfxthirteen =    0x00;
  717.   tool->vrfxfourteen =    0x00;
  718.   tool->vrfxfifteen =     0x00;
  719.   tool->vrfxsixteen =     0x00;
  720.   tool->vrfxseventeen =   0x14;
  721.   tool->vrfxeighteen =    0x0c;
  722.   tool->vrfxnineteen =    0x12;
  723.   tool->vrfxtwenty =      0x0c;
  724.  
  725.   tool->typesysex       = NULL;
  726.   tool->onesysex        = NULL;
  727.   tool->twosysex        = NULL;
  728.   tool->threesysex      = NULL;
  729.   tool->foursysex       = NULL;
  730.   tool->fivesysex       = NULL;
  731.   tool->sixsysex        = NULL;
  732.   tool->sevensysex      = NULL;
  733.   tool->eightsysex      = NULL;
  734.   tool->ninesysex       = NULL;
  735.   tool->tensysex        = NULL;
  736.   tool->elevensysex     = NULL;
  737.   tool->twelvesysex     = NULL;
  738.   tool->thirteensysex   = NULL;
  739.   tool->fourteensysex   = NULL;
  740.   tool->fifteensysex    = NULL;
  741.   tool->sixteensysex    = NULL;
  742.   tool->seventeensysex  = NULL;
  743.   tool->eighteensysex   = NULL;
  744.   tool->nineteensysex   = NULL;
  745.   tool->twentysysex     = NULL;
  746.  
  747.   tool->tool.touched = TOUCH_INIT;
  748. }
  749.  
  750.  
  751. static struct Event * __saveds processeventcode(struct Event *event)
  752. {
  753.   event->tool = event->tool->next;
  754.   return(event);
  755. }
  756. // the routine for sending SysEx-data thru the pipeline
  757.  
  758. static void __saveds sendsysex(char *buff,  short size,  struct VXXGTool *tool,  const LONG time)
  759. {
  760.     struct StringEvent *event;
  761.     struct String *string;
  762.  
  763.     event = (struct StringEvent *) (*functions->allocevent)();
  764.      if (event)
  765.       {
  766.         string = (struct String *) (*functions->myalloc)(size + 3, MEMF_CLEAR);
  767.         if (string)
  768.         {
  769.             event->string = string;
  770.             memcpy(string->string,  buff,  size);
  771.             string->length = size + 2;
  772.             event->type = EVENT_SYSX;
  773.             event->status = MIDI_SYSX;
  774.             event->time = time;
  775.             event->tool = tool->tool.next;
  776.             WaitTOF();
  777.             (*functions->qevent)(event);
  778.             (*functions->myfree)(string);
  779.         }
  780.       }
  781.  
  782. }
  783.  
  784. //the necessary functions for writing to track
  785.  
  786. static BOOL lock_clip(struct Clip *clip)
  787. {
  788.   Forbid();
  789.   if (clip->locked == 0)
  790.     {
  791.       clip->locked = 1;
  792.       Permit();
  793.       return TRUE;
  794.     }
  795.   else
  796.     {
  797.       Permit();
  798.       return FALSE;
  799.     }
  800. }
  801.  
  802. static void unlock_clip(struct Clip *clip)
  803. {
  804.   clip->locked = 0;
  805. }
  806.  
  807. //writes sysex into track
  808.  
  809. static void __saveds insertsysex(char *buff, short size, struct VXXGTool *tool,  const LONG time)
  810. {
  811.     struct StringEvent *event;
  812.     struct String *string;
  813.  
  814.     event = (struct StringEvent *) (*functions->allocevent)();
  815.      if (event)
  816.       {
  817.         string = (struct String *) (*functions->myalloc)(size + 3, MEMF_CLEAR);
  818.         if (string)
  819.         {
  820.             event->next = NULL;
  821.             event->string = string;
  822.             memcpy(string->string,  buff,  size);
  823.             string->length = size + 2;
  824.             event->type = EVENT_SYSX;
  825.             event->status = MIDI_SYSX;
  826.             event->time = time;
  827.             event->tool = tool->tool.next;
  828.             if (lock_clip(&(tool->tool.track->clip)))
  829.               {
  830.                 event->next = (struct StringEvent *)tool->tool.track->clip.events.first;
  831.                 tool->tool.track->clip.events.first = (struct Event *)(*functions->sorteventlist)(event);
  832.                 unlock_clip(&(tool->tool.track->clip));
  833.               }
  834.             else
  835.               {
  836.                 (*functions->freelist)(event);
  837.               }
  838.  
  839.         }
  840.       }
  841.  
  842. }
  843.  
  844. static void __saveds transsysex(struct VXXGTool *tool,  const LONG time,  char *sysx, short sel)
  845. {
  846.   LONG size;
  847.   int a,  b,  x,  y ;
  848.   UBYTE abuf[32];
  849.   char chr[4];
  850.   char *zbuf = NULL;
  851.  
  852.     //translate tool->typesysexer into hex
  853.  
  854.   size = strlen(sysx);
  855.   zbuf = (char *)AllocVec(size+2,  MEMF_ANY|MEMF_CLEAR);
  856.   if(zbuf)
  857.      {
  858.        CopyMem(sysx,  zbuf,  size);
  859.        b=0;
  860.        for(a=0;a < size;a=a+2)
  861.            {
  862.              chr[0] = zbuf[a];
  863.              chr[1] = zbuf[a+1];
  864.  
  865.              x=(isdigit((int)chr[0]))? (chr[0]&0xF) : ((chr[0]&0xDF)-55); //this is the
  866.              y=(isdigit((int)chr[1]))? (chr[1]&0xF) : ((chr[1]&0xDF)-55); //the translate-core
  867.  
  868.              abuf[b++] = ((x<<4)|y);   //writing with bitmanipulation
  869.             }
  870.       //send hexdata
  871.  
  872.        FreeVec(zbuf);
  873.        if (sel == 0) insertsysex(abuf, b, tool,  time);
  874.        if (sel == 1) sendsysex(abuf, b, tool,  time);
  875.  
  876.      }
  877.  
  878. }
  879.  
  880. //displays the slider-label
  881.  
  882. void __saveds label(struct RastPort *rp, int y, char *textt)
  883. {
  884.   char text[10];
  885.  
  886.   sprintf(text, "%9.9s", textt);
  887.   Move(rp, 7, y);
  888.   Text(rp, text, 9);
  889. }
  890.  
  891. //displays the selection in the slider-labels
  892.  
  893. void __saveds select(struct RastPort *rp, int y, char *textt, UBYTE zahl)
  894. {
  895.   char text[6];
  896.  
  897.   sprintf(text, "%6.6s", textt);
  898.   Move(rp, 7, y);
  899.   Text(rp, text, 9);
  900. }
  901.  
  902.  
  903. // Writes all values of the sliders and more  in the main window
  904.  
  905. LONG __saveds display_routine(struct Window *window, struct Gadget *gadget, ULONG value)
  906. {
  907.   int i=0;
  908.   char *vrfxtypet, *inputt, *atypt, *ertypt, *pdirt;
  909.   char text[10];
  910.   char vrfxtypetext[20];
  911.   char inputtext[6];
  912.   char atyptext[6];
  913.   char ertyptext[6];
  914.   char pdirtext[6];
  915.   char name[15];
  916.   const short id = gadget->GadgetID;
  917.   struct RastPort *rp = window->RPort;
  918.  
  919.   char vrfxtypename[42][17]={
  920.   "Hall 1           ","Hall 2           ","Room 1           ","Room 2           ","Room 3           ",
  921.   "Stage 1          ","Stage 2          ","Plate            ","Delay LCR        ","Delay LR         ",
  922.   "Echo             ","Cross Delay      ","EarlyReflection 1","EarlyReflection 2","Gate Reverb      ",
  923.   "Reverse Gate     ","Karaoke 1        ","Karaoke 2        ","Karaoke 3        ","Chorus 1         ",
  924.   "Chorus 2         ","Chorus 3         ","Chorus 4         ","Celeste 1        ","Celeste 2        ",
  925.   "Celeste 3        ","Celeste 4        ","Flanger 1        ","Flanger 2        ","Flanger 3        ",
  926.   "Symphonic        ","Rotary Speaker   ","Tremolo          ","Auto Pan         ","Phaser 1         ",
  927.   "Phaser 2         ","Distortion       ","Overdrive        ","Guitar Amplifier ","Auto Wah         ",
  928.   "3-Band-Equalizer ","2-Band-Equalizer "};
  929.  
  930.   char propname[62][9]={
  931.   "         ",  //  0
  932.   "AM Depth ",  //  1
  933.   "ATyp     ",  //  2
  934.   "CchDelay ",  //  3
  935.   "CchLevel ",  //  4
  936.   "CtofFrqOf",  //  5
  937.   "Delay2Lvl",  //  6
  938.   "DelayOffs",  //  7
  939.   "DelayTime",  //  8
  940.   "Density  ",  //  9
  941.   "Diffusion",  // 10
  942.   "Drive    ",  // 11
  943.   "Dry<->Wet",  // 12
  944.   "EdgClpCve",  // 13
  945.   "EqHigFreq",  // 14
  946.   "EqHigGain",  // 15
  947.   "EqLowFreq",  // 16
  948.   "EqLowGain",  // 17
  949.   "EqMidFreq",  // 18
  950.   "EqMidGain",  // 19
  951.   "EqMidWdth",  // 20
  952.   "LFOPhDiff",  // 21
  953.   "ERTyp    ",  // 22
  954.   "F/R Depth",  // 23
  955.   "FeedbLevl",  // 24
  956.   "FeedbDlay",  // 25
  957.   "FeedbDly1",  // 26
  958.   "FeedbDly2",  // 27
  959.   "HighDamp ",  // 28
  960.   "HpfCutoff",  // 29
  961.   "InitDelay",  // 30
  962.   "Input:   ",  // 31
  963.   "L->RDelay",  // 32
  964.   "L/R Depth",  // 33
  965.   "LchDelay ",  // 34
  966.   "LchDelay1",  // 35
  967.   "LchDelay2",  // 36
  968.   "LchFdbLvl",  // 37
  969.   "LFOFreqnc",  // 38
  970.   "LFODepth ",  // 39
  971.   "Liveness ",  // 40
  972.   "LpfCutoff",  // 41
  973.   "OutputLvl",  // 42
  974.   "PDir     ",  // 43
  975.   "PhShtOffs",  // 44
  976.   "PM Depth ",  // 45
  977.   "R->LDelay",  // 46
  978.   "RchDelay ",  // 47
  979.   "RchDelay1",  // 48
  980.   "RchDelay2",  // 49
  981.   "RchFdbLvl",  // 50
  982.   "Resonance",  // 51
  983.   "RevTime  ",  // 52
  984.   "RoomSize ",  // 53
  985.   "SndVxtoCh",  // 54
  986.   "SndVxtoRv",  // 55
  987.   "Typ:     ",  // 56
  988.   "Stage    ",  // 57
  989.   "VarPan   ",  // 58
  990.   "VarReturn",  // 59
  991.   "RevDelay ",  // 60
  992.   "Er/RevBal"}; // 61
  993.  
  994.  
  995.   char input[7][2]={
  996.   "Mo","St"," L"," R","LR"," A"," B"};
  997.   char atyp[4][5]={
  998.   "  off","Stack","Combo"," Tube"};
  999.   char ertyp[6][3]={
  1000.   "S-H","L-H","Rdm","Rvs","Plt","Spr"};
  1001.   char pdir[6][4]={
  1002.   "L<>R"," L>R"," R>L","Ltrn","Rtrn"," L.R"};
  1003.  
  1004.          switch (id)
  1005.               {
  1006.               case VXTYPE_GADGET:
  1007.                 vrfxtypet = vrfxtypename[value];
  1008.                 sprintf(vrfxtypetext,  "%17.17s",  vrfxtypet);
  1009.                 SetAPen(rp, 7);
  1010.                 SetBPen(rp, 6);
  1011.                 SetDrMd(rp,  INVERSVID|JAM2);
  1012.                 Move(rp,  83, 26);
  1013.                 Text(rp,  vrfxtypetext,  17);
  1014.                 SetAPen(rp,  2);
  1015.                 SetBPen(rp,  0);
  1016.                 SetDrMd(rp,  JAM2);
  1017.                       if ((value == hall1)|
  1018.                          (value == hall2)|
  1019.                          (value == room1)|
  1020.                          (value == room2)|
  1021.                          (value == room3)|
  1022.                          (value == stage1)|
  1023.                          (value == stage2)|
  1024.                          (value == plate))
  1025.                      {
  1026.                      label(rp, 49,propname[52]);
  1027.                      label(rp, 60,propname[10]);
  1028.                      label(rp, 71,propname[30]);
  1029.                      label(rp, 82,propname[29]);
  1030.                      label(rp, 93,propname[41]);
  1031.                      label(rp,104,propname[0]);
  1032.                      label(rp,115,propname[0]);
  1033.                      label(rp,126,propname[0]);
  1034.                      label(rp,137,propname[0]);
  1035.                      label(rp,148,propname[12]);
  1036.  
  1037.  
  1038.                      if ((value == hall1)|(value == stage1))
  1039.                          {
  1040.                          label(rp,159,propname[59]);
  1041.                          label(rp,170,propname[58]);
  1042.                          label(rp,181,propname[55]);
  1043.                          label(rp,192,propname[54]);
  1044.                          }
  1045.  
  1046.                      else
  1047.                          {
  1048.                          label(rp,159,propname[0]);
  1049.                          label(rp,170,propname[0]);
  1050.                          label(rp,181,propname[0]);
  1051.                          label(rp,192,propname[0]);
  1052.                          }
  1053.  
  1054.                      label(rp,203,propname[0]);
  1055.                      label(rp,214,propname[60]);
  1056.                      label(rp,225,propname[9]);
  1057.                      label(rp,236,propname[61]);
  1058.                      label(rp,247,propname[24]);
  1059.                      label(rp,258,propname[0]);
  1060.  
  1061.                      SetAPen(rp,  1);
  1062.                      }
  1063.                     else if (value == delaylcr)
  1064.                      {
  1065.                      label(rp, 49,propname[34]);    //42
  1066.                      label(rp, 60,propname[47]);    //44
  1067.                      label(rp, 71,propname[3]);     //46
  1068.                      label(rp, 82,propname[25]);    //48
  1069.                      label(rp, 93,propname[24]);    //4a
  1070.                      label(rp,104,propname[4]);     //4c
  1071.                      label(rp,115,propname[28]);    //4e
  1072.                      label(rp,126,propname[0]);     //50
  1073.                      label(rp,137,propname[0]);     //52
  1074.                      label(rp,148,propname[12]);    //54
  1075.                      label(rp,159,propname[59]);    //56
  1076.                      label(rp,170,propname[58]);    //57
  1077.                      label(rp,181,propname[55]);    //58
  1078.                      label(rp,192,propname[54]);    //59
  1079.                      label(rp,203,propname[0]);     //70
  1080.                      label(rp,214,propname[0]);     //71
  1081.                      label(rp,225,propname[16]);    //72
  1082.                      label(rp,236,propname[17]);    //73
  1083.                      label(rp,247,propname[14]);    //74
  1084.                      label(rp,258,propname[15]);    //75
  1085.  
  1086.                      SetAPen(rp,  1);
  1087.                      }
  1088.                     else if (value == delaylr)
  1089.                      {
  1090.                      label(rp, 49,propname[34]);    //42
  1091.                      label(rp, 60,propname[47]);    //44
  1092.                      label(rp, 71,propname[26]);    //46
  1093.                      label(rp, 82,propname[27]);    //48
  1094.                      label(rp, 93,propname[24]);    //4a
  1095.                      label(rp,104,propname[28]);    //4c
  1096.                      label(rp,115,propname[0]);     //4e
  1097.                      label(rp,126,propname[0]);     //50
  1098.                      label(rp,137,propname[0]);     //52
  1099.                      label(rp,148,propname[12]);    //54
  1100.                      label(rp,159,propname[59]);    //56
  1101.                      label(rp,170,propname[58]);    //57
  1102.                      label(rp,181,propname[55]);    //58
  1103.                      label(rp,192,propname[54]);    //59
  1104.                      label(rp,203,propname[0]);     //70
  1105.                      label(rp,214,propname[0]);     //71
  1106.                      label(rp,225,propname[16]);    //72
  1107.                      label(rp,236,propname[17]);    //73
  1108.                      label(rp,247,propname[14]);    //74
  1109.                      label(rp,258,propname[15]);    //75
  1110.  
  1111.                      SetAPen(rp,  1);
  1112.                      }
  1113.                     else if (value == echo)
  1114.                      {
  1115.                      label(rp, 49,propname[35]);    //42
  1116.                      label(rp, 60,propname[37]);    //44
  1117.                      label(rp, 71,propname[48]);    //46
  1118.                      label(rp, 82,propname[50]);    //48
  1119.                      label(rp, 93,propname[28]);    //4a
  1120.                      label(rp,104,propname[36]);    //4c
  1121.                      label(rp,115,propname[49]);    //4e
  1122.                      label(rp,126,propname[6]);     //50
  1123.                      label(rp,137,propname[0]);     //52
  1124.                      label(rp,148,propname[12]);    //54
  1125.                      label(rp,159,propname[59]);    //56
  1126.                      label(rp,170,propname[58]);    //57
  1127.                      label(rp,181,propname[55]);    //58
  1128.                      label(rp,192,propname[54]);    //59
  1129.                      label(rp,203,propname[0]);     //70
  1130.                      label(rp,214,propname[0]);     //71
  1131.                      label(rp,225,propname[16]);    //72
  1132.                      label(rp,236,propname[17]);    //73
  1133.                      label(rp,247,propname[14]);    //74
  1134.                      label(rp,258,propname[15]);    //75
  1135.  
  1136.                      SetAPen(rp,  1);
  1137.                      }
  1138.                     else if (value == crossdelay)
  1139.                      {
  1140.                      label(rp, 49,propname[32]);    //42
  1141.                      label(rp, 60,propname[46]);    //44
  1142.                      label(rp, 71,propname[24]);    //46
  1143.                      label(rp, 82,propname[31]);    //48
  1144.                      label(rp, 93,propname[28]);    //4a
  1145.                      label(rp,104,propname[0]);     //4c
  1146.                      label(rp,115,propname[0]);     //4e
  1147.                      label(rp,126,propname[0]);     //50
  1148.                      label(rp,137,propname[0]);     //52
  1149.                      label(rp,148,propname[12]);    //54
  1150.                      label(rp,159,propname[59]);    //56
  1151.                      label(rp,170,propname[58]);    //57
  1152.                      label(rp,181,propname[55]);    //58
  1153.                      label(rp,192,propname[54]);    //59
  1154.                      label(rp,203,propname[0]);     //70
  1155.                      label(rp,214,propname[0]);     //71
  1156.                      label(rp,225,propname[16]);    //72
  1157.                      label(rp,236,propname[17]);    //73
  1158.                      label(rp,247,propname[14]);    //74
  1159.                      label(rp,258,propname[15]);    //75
  1160.  
  1161.                      SetAPen(rp,  1);
  1162.                      }
  1163.                     else if ((value == earlyrefl1)|
  1164.                             (value == earlyrefl2))
  1165.                      {
  1166.                      label(rp, 49,propname[22]);
  1167.                      label(rp, 60,propname[53]);
  1168.                      label(rp, 71,propname[30]);
  1169.                      label(rp, 82,propname[10]);
  1170.                      label(rp, 93,propname[24]);
  1171.                      label(rp,104,propname[29]);
  1172.                      label(rp,115,propname[41]);
  1173.                      label(rp,126,propname[0]);
  1174.                      label(rp,137,propname[0]);
  1175.                      label(rp,148,propname[12]);
  1176.                      label(rp,159,propname[59]);
  1177.                      label(rp,170,propname[58]);
  1178.                      label(rp,181,propname[55]);
  1179.                      label(rp,192,propname[54]);
  1180.                      label(rp,203,propname[40]);
  1181.                      label(rp,214,propname[9]);
  1182.                      label(rp,225,propname[28]);
  1183.                      label(rp,236,propname[0]);
  1184.                      label(rp,247,propname[0]);
  1185.                      label(rp,258,propname[0]);
  1186.  
  1187.                      SetAPen(rp,  1);
  1188.                      }
  1189.                     else if ((value == gatereverb)|
  1190.                             (value == reversegate))
  1191.                      {
  1192.                      label(rp, 49,propname[56]);
  1193.                      label(rp, 60,propname[53]);
  1194.                      label(rp, 71,propname[10]);
  1195.                      label(rp, 82,propname[30]);
  1196.                      label(rp, 93,propname[24]);
  1197.                      label(rp,104,propname[29]);
  1198.                      label(rp,115,propname[41]);
  1199.                      label(rp,126,propname[0]);
  1200.                      label(rp,137,propname[0]);
  1201.                      label(rp,148,propname[12]);
  1202.                      label(rp,159,propname[59]);
  1203.                      label(rp,170,propname[58]);
  1204.                      label(rp,181,propname[55]);
  1205.                      label(rp,192,propname[54]);
  1206.                      label(rp,203,propname[40]);
  1207.                      label(rp,214,propname[9]);
  1208.                      label(rp,225,propname[28]);
  1209.                      label(rp,236,propname[0]);
  1210.                      label(rp,247,propname[0]);
  1211.                      label(rp,258,propname[0]);
  1212.  
  1213.                      SetAPen(rp,  1);
  1214.                      }
  1215.  
  1216.                     else if ((value == karaoke1)|
  1217.                              (value == karaoke2)|
  1218.                              (value == karaoke3))
  1219.                      {
  1220.                      label(rp, 49,propname[8]);
  1221.                      label(rp, 60,propname[24]);
  1222.                      label(rp, 71,propname[29]);
  1223.                      label(rp, 82,propname[41]);
  1224.                      label(rp, 93,propname[0]);
  1225.                      label(rp,104,propname[0]);
  1226.                      label(rp,115,propname[0]);
  1227.                      label(rp,126,propname[0]);
  1228.                      label(rp,137,propname[0]);
  1229.                      label(rp,148,propname[12]);
  1230.  
  1231.                      if (value == karaoke1)
  1232.                          {
  1233.                          label(rp,159,propname[59]);
  1234.                          label(rp,170,propname[58]);
  1235.                          label(rp,181,propname[55]);
  1236.                          label(rp,192,propname[54]);
  1237.  
  1238.                          }
  1239.                       else
  1240.                          {
  1241.                          label(rp,159,propname[0]);
  1242.                          label(rp,170,propname[0]);
  1243.                          label(rp,181,propname[0]);
  1244.                          label(rp,192,propname[0]);
  1245.                          }
  1246.  
  1247.                      label(rp,203,propname[0]);
  1248.                      label(rp,214,propname[0]);
  1249.                      label(rp,225,propname[0]);
  1250.                      label(rp,236,propname[0]);
  1251.                      label(rp,247,propname[0]);
  1252.                      label(rp,258,propname[0]);
  1253.  
  1254.                      SetAPen(rp,  1);
  1255.                      }
  1256.                     else if ((value == chorus1)|
  1257.                             (value == chorus2)|
  1258.                             (value == chorus3)|
  1259.                             (value == chorus4)|
  1260.                             (value == celeste1)|
  1261.                             (value == celeste2)|
  1262.                             (value == celeste3)|
  1263.                             (value == celeste4))
  1264.                      {
  1265.                      label(rp, 49,propname[38]);
  1266.                      label(rp, 60,propname[39]);
  1267.                      label(rp, 71,propname[24]);
  1268.                      label(rp, 82,propname[7]);
  1269.                      label(rp, 93,propname[0]);
  1270.                      label(rp,104,propname[16]);
  1271.                      label(rp,115,propname[17]);
  1272.                      label(rp,126,propname[14]);
  1273.                      label(rp,137,propname[15]);
  1274.                      label(rp,148,propname[12]);
  1275.  
  1276.                      if ((value == chorus1)|(value == celeste1))
  1277.                          {
  1278.                          label(rp,159,propname[59]);
  1279.                          label(rp,170,propname[58]);
  1280.                          label(rp,181,propname[55]);
  1281.                          label(rp,192,propname[54]);
  1282.                          }
  1283.                       else
  1284.                          {
  1285.                          label(rp,159,propname[0]);
  1286.                          label(rp,170,propname[0]);
  1287.                          label(rp,181,propname[0]);
  1288.                          label(rp,192,propname[0]);
  1289.                          }
  1290.  
  1291.                      label(rp,203,propname[0]);
  1292.                      label(rp,214,propname[0]);
  1293.                      label(rp,225,propname[0]);
  1294.                      label(rp,236,propname[0]);
  1295.                      label(rp,247,propname[31]);
  1296.                      label(rp,258,propname[0]);
  1297.  
  1298.                      SetAPen(rp,  1);
  1299.                      }
  1300.                     else if ((value == flanger1)|
  1301.                             (value == flanger2)|
  1302.                             (value == flanger3))
  1303.                      {
  1304.                      label(rp, 49,propname[38]);
  1305.                      label(rp, 60,propname[39]);
  1306.                      label(rp, 71,propname[24]);
  1307.                      label(rp, 82,propname[7]);
  1308.                      label(rp, 93,propname[0]);
  1309.                      label(rp,104,propname[16]);
  1310.                      label(rp,115,propname[17]);
  1311.                      label(rp,126,propname[14]);
  1312.                      label(rp,137,propname[15]);
  1313.                      label(rp,148,propname[12]);
  1314.  
  1315.                      if (value == flanger1)
  1316.                          {
  1317.                           label(rp,159,propname[59]);
  1318.                           label(rp,170,propname[58]);
  1319.                           label(rp,181,propname[55]);
  1320.                           label(rp,192,propname[54]);
  1321.                          }
  1322.                       else
  1323.                          {
  1324.                           label(rp,159,propname[0]);
  1325.                           label(rp,170,propname[0]);
  1326.                           label(rp,181,propname[0]);
  1327.                           label(rp,192,propname[0]);
  1328.                          }
  1329.  
  1330.                      label(rp,203,propname[0]);
  1331.                      label(rp,214,propname[0]);
  1332.                      label(rp,225,propname[0]);
  1333.                      label(rp,236,propname[21]);
  1334.                      label(rp,247,propname[0]);
  1335.                      label(rp,258,propname[0]);
  1336.  
  1337.                      SetAPen(rp,  1);
  1338.                      }
  1339.                     else if ((value == symphonic)|
  1340.                             (value == rotaryspeaker))
  1341.                      {
  1342.                      label(rp, 49,propname[38]);
  1343.                      label(rp, 60,propname[39]);
  1344.                      label(rp, 71,propname[7]);
  1345.                      label(rp, 82,propname[0]);
  1346.                      label(rp, 93,propname[0]);
  1347.                      label(rp,104,propname[16]);
  1348.                      label(rp,115,propname[17]);
  1349.                      label(rp,126,propname[14]);
  1350.                      label(rp,137,propname[15]);
  1351.                      label(rp,148,propname[12]);
  1352.                      label(rp,159,propname[59]);
  1353.                      label(rp,170,propname[58]);
  1354.                      label(rp,181,propname[55]);
  1355.                      label(rp,192,propname[54]);
  1356.                      label(rp,203,propname[0]);
  1357.                      label(rp,214,propname[0]);
  1358.                      label(rp,225,propname[0]);
  1359.                      label(rp,236,propname[0]);
  1360.                      label(rp,247,propname[0]);
  1361.                      label(rp,258,propname[0]);
  1362.  
  1363.                      SetAPen(rp,  1);
  1364.                      }
  1365.                     else if (value == tremolo)
  1366.                      {
  1367.                      label(rp, 49,propname[38]);
  1368.                      label(rp, 60,propname[1]);
  1369.                      label(rp, 71,propname[45]);
  1370.                      label(rp, 82,propname[0]);
  1371.                      label(rp, 93,propname[0]);
  1372.                      label(rp,104,propname[16]);
  1373.                      label(rp,115,propname[17]);
  1374.                      label(rp,126,propname[14]);
  1375.                      label(rp,137,propname[15]);
  1376.                      label(rp,148,propname[12]);
  1377.                      label(rp,159,propname[59]);
  1378.                      label(rp,170,propname[58]);
  1379.                      label(rp,181,propname[55]);
  1380.                      label(rp,192,propname[54]);
  1381.                      label(rp,203,propname[0]);
  1382.                      label(rp,214,propname[0]);
  1383.                      label(rp,225,propname[0]);
  1384.                      label(rp,236,propname[21]);
  1385.                      label(rp,247,propname[31]);
  1386.                      label(rp,258,propname[0]);
  1387.  
  1388.                      SetAPen(rp,  1);
  1389.                      }
  1390.                     else if (value == autopan)
  1391.                      {
  1392.                      label(rp, 49,propname[38]);
  1393.                      label(rp, 60,propname[33]);
  1394.                      label(rp, 71,propname[23]);
  1395.                      label(rp, 82,propname[43]);
  1396.                      label(rp, 93,propname[0]);
  1397.                      label(rp,104,propname[16]);
  1398.                      label(rp,115,propname[17]);
  1399.                      label(rp,126,propname[14]);
  1400.                      label(rp,137,propname[15]);
  1401.                      label(rp,148,propname[12]);
  1402.                      label(rp,159,propname[59]);
  1403.                      label(rp,170,propname[58]);
  1404.                      label(rp,181,propname[55]);
  1405.                      label(rp,192,propname[54]);
  1406.                      label(rp,203,propname[0]);
  1407.                      label(rp,214,propname[0]);
  1408.                      label(rp,225,propname[0]);
  1409.                      label(rp,236,propname[0]);
  1410.                      label(rp,247,propname[0]);
  1411.                      label(rp,258,propname[0]);
  1412.  
  1413.                      SetAPen(rp,  1);
  1414.                      }
  1415.                     else if ((value == phaser1)|
  1416.                             (value == phaser2))
  1417.                      {
  1418.                      label(rp, 49,propname[38]);
  1419.                      label(rp, 60,propname[39]);
  1420.                      label(rp, 71,propname[44]);
  1421.                      label(rp, 82,propname[24]);
  1422.                      label(rp, 93,propname[0]);
  1423.                      label(rp,104,propname[16]);
  1424.                      label(rp,115,propname[17]);
  1425.                      label(rp,126,propname[14]);
  1426.                      label(rp,137,propname[15]);
  1427.                      label(rp,148,propname[12]);
  1428.  
  1429.                      if (value == phaser1)
  1430.                          {
  1431.                          label(rp,159,propname[59]);
  1432.                          label(rp,170,propname[58]);
  1433.                          label(rp,181,propname[55]);
  1434.                          label(rp,192,propname[54]);
  1435.                          }
  1436.                       else
  1437.                          {
  1438.                          label(rp,159,propname[0]);
  1439.                          label(rp,170,propname[0]);
  1440.                          label(rp,181,propname[0]);
  1441.                          label(rp,192,propname[0]);
  1442.                          }
  1443.  
  1444.                      label(rp,203,propname[57]);
  1445.                      label(rp,214,propname[10]);
  1446.                      label(rp,225,propname[21]);
  1447.                      label(rp,236,propname[0]);
  1448.                      label(rp,247,propname[0]);
  1449.                      label(rp,258,propname[0]);
  1450.  
  1451.                      SetAPen(rp,  1);
  1452.                      }
  1453.                     else if ((value == distortion)|
  1454.                             (value == overdrive))
  1455.                      {
  1456.                      label(rp, 49,propname[11]);
  1457.                      label(rp, 60,propname[16]);
  1458.                      label(rp, 71,propname[17]);
  1459.                      label(rp, 82,propname[41]);
  1460.                      label(rp, 93,propname[42]);
  1461.                      label(rp,104,propname[0]);
  1462.                      label(rp,115,propname[18]);
  1463.                      label(rp,126,propname[19]);
  1464.                      label(rp,137,propname[20]);
  1465.                      label(rp,148,propname[12]);
  1466.  
  1467.                      if (value == distortion)
  1468.                          {
  1469.                          label(rp,159,propname[59]);
  1470.                          label(rp,170,propname[58]);
  1471.                          label(rp,181,propname[55]);
  1472.                          label(rp,192,propname[54]);
  1473.                          }
  1474.                       else
  1475.                          {
  1476.                          label(rp,159,propname[0]);
  1477.                          label(rp,170,propname[0]);
  1478.                          label(rp,181,propname[0]);
  1479.                          label(rp,192,propname[0]);
  1480.                          }
  1481.                      label(rp,203,propname[13]);
  1482.                      label(rp,214,propname[0]);
  1483.                      label(rp,225,propname[0]);
  1484.                      label(rp,236,propname[0]);
  1485.                      label(rp,247,propname[0]);
  1486.                      label(rp,258,propname[0]);
  1487.  
  1488.                      SetAPen(rp,  1);
  1489.                      }
  1490.                     else if (value == guitaramp)
  1491.                      {
  1492.                      label(rp, 49,propname[11]);
  1493.                      label(rp, 60,propname[2]);
  1494.                      label(rp, 71,propname[41]);
  1495.                      label(rp, 82,propname[42]);
  1496.                      label(rp, 93,propname[0]);
  1497.                      label(rp,104,propname[0]);
  1498.                      label(rp,115,propname[0]);
  1499.                      label(rp,126,propname[0]);
  1500.                      label(rp,137,propname[0]);
  1501.                      label(rp,148,propname[0]);
  1502.                      label(rp,159,propname[59]);
  1503.                      label(rp,170,propname[58]);
  1504.                      label(rp,181,propname[55]);
  1505.                      label(rp,192,propname[54]);
  1506.                      label(rp,203,propname[13]);
  1507.                      label(rp,214,propname[0]);
  1508.                      label(rp,225,propname[0]);
  1509.                      label(rp,236,propname[0]);
  1510.                      label(rp,247,propname[0]);
  1511.                      label(rp,258,propname[0]);
  1512.  
  1513.                      SetAPen(rp,  1);
  1514.                      }
  1515.                     else if (value == autowah)
  1516.                      {
  1517.                      label(rp, 49,propname[38]);
  1518.                      label(rp, 60,propname[39]);
  1519.                      label(rp, 71,propname[5]);
  1520.                      label(rp, 82,propname[51]);
  1521.                      label(rp, 93,propname[0]);
  1522.                      label(rp,104,propname[16]);
  1523.                      label(rp,115,propname[17]);
  1524.                      label(rp,126,propname[14]);
  1525.                      label(rp,137,propname[15]);
  1526.                      label(rp,148,propname[12]);
  1527.                      label(rp,159,propname[59]);
  1528.                      label(rp,170,propname[58]);
  1529.                      label(rp,181,propname[55]);
  1530.                      label(rp,192,propname[54]);
  1531.                      label(rp,203,propname[0]);
  1532.                      label(rp,214,propname[0]);
  1533.                      label(rp,225,propname[0]);
  1534.                      label(rp,236,propname[0]);
  1535.                      label(rp,247,propname[0]);
  1536.                      label(rp,258,propname[0]);
  1537.  
  1538.                      SetAPen(rp,  1);
  1539.                      }
  1540.                     else if (value == monoeq)
  1541.                      {
  1542.                      label(rp, 49,propname[17]);
  1543.                      label(rp, 60,propname[18]);
  1544.                      label(rp, 71,propname[19]);
  1545.                      label(rp, 82,propname[20]);
  1546.                      label(rp, 93,propname[15]);
  1547.                      label(rp,104,propname[16]);
  1548.                      label(rp,115,propname[14]);
  1549.                      label(rp,126,propname[0]);
  1550.                      label(rp,137,propname[0]);
  1551.                      label(rp,148,propname[0]);
  1552.                      label(rp,159,propname[59]);
  1553.                      label(rp,170,propname[58]);
  1554.                      label(rp,181,propname[55]);
  1555.                      label(rp,192,propname[54]);
  1556.                      label(rp,203,propname[0]);
  1557.                      label(rp,214,propname[0]);
  1558.                      label(rp,225,propname[0]);
  1559.                      label(rp,236,propname[0]);
  1560.                      label(rp,247,propname[0]);
  1561.                      label(rp,258,propname[0]);
  1562.  
  1563.                      SetAPen(rp,  1);
  1564.                      }
  1565.                     else if (value == stereoeq)
  1566.                      {
  1567.                      label(rp, 49,propname[16]);
  1568.                      label(rp, 60,propname[17]);
  1569.                      label(rp, 71,propname[14]);
  1570.                      label(rp, 82,propname[15]);
  1571.                      label(rp, 93,propname[0]);
  1572.                      label(rp,104,propname[0]);
  1573.                      label(rp,115,propname[0]);
  1574.                      label(rp,126,propname[0]);
  1575.                      label(rp,137,propname[0]);
  1576.                      label(rp,148,propname[0]);
  1577.                      label(rp,159,propname[59]);
  1578.                      label(rp,170,propname[58]);
  1579.                      label(rp,181,propname[55]);
  1580.                      label(rp,192,propname[54]);
  1581.                      label(rp,203,propname[0]);
  1582.                      label(rp,214,propname[0]);
  1583.                      label(rp,225,propname[0]);
  1584.                      label(rp,236,propname[0]);
  1585.                      label(rp,247,propname[0]);
  1586.                      label(rp,258,propname[0]);
  1587.  
  1588.                      SetAPen(rp,  1);
  1589.                      }
  1590.                 Move(rp,  240,  37);
  1591.                 break;
  1592.               case VXONE_GADGET:
  1593.                 if ((typeval == gatereverb)|(typeval == reversegate))
  1594.                     {
  1595.                      inputt = input[value+5];
  1596.                      sprintf(inputtext,  "%2.2s",  inputt);
  1597.                      SetAPen(rp, 6);
  1598.                      SetBPen(rp, 7);
  1599.                      SetDrMd(rp,  INVERSVID|JAM2);
  1600.                      Move(rp,  50, 49);
  1601.                      Text(rp,  inputtext,  2);
  1602.                      SetAPen(rp,  2);
  1603.                      SetBPen(rp,  0);
  1604.                      SetDrMd(rp,  JAM2);
  1605.                     }
  1606.                 if ((typeval == earlyrefl1)||(typeval == earlyrefl2))
  1607.                     {
  1608.                      ertypt = ertyp[value];
  1609.                      sprintf(ertyptext,  "%3.3s",  ertypt);
  1610.                      SetAPen(rp, 6);
  1611.                      SetBPen(rp, 7);
  1612.                      SetDrMd(rp,  INVERSVID|JAM2);
  1613.                      Move(rp,  50, 49);
  1614.                      Text(rp,  ertyptext,  3);
  1615.                      SetAPen(rp,  2);
  1616.                      SetBPen(rp,  0);
  1617.                      SetDrMd(rp,  JAM2);
  1618.                     }
  1619.                  if (typeval == monoeq) value = value + 0x34;
  1620.                  if (typeval == stereoeq) value = value + 0x08;
  1621.                 Move(rp,  240,  48);
  1622.                 break;
  1623.               case VXTWO_GADGET:
  1624.                 if (typeval == guitaramp)
  1625.                     {
  1626.                      atypt = atyp[value];
  1627.                      sprintf(atyptext,  "%5.5s",  atypt);
  1628.                      SetAPen(rp, 6);
  1629.                      SetBPen(rp, 7);
  1630.                      SetDrMd(rp,  INVERSVID|JAM2);
  1631.                      Move(rp,  38, 60);
  1632.                      Text(rp,  atyptext,  5);
  1633.                      SetAPen(rp,  2);
  1634.                      SetBPen(rp,  0);
  1635.                      SetDrMd(rp,  JAM2);
  1636.                     }
  1637.                  if (typeval == monoeq) value = value + 0x1c;
  1638.                  if (typeval == stereoeq) value = value + 0x34;
  1639.                 Move(rp,  240,  59);
  1640.                 break;
  1641.               case VXTHREE_GADGET:
  1642.                  if (typeval == monoeq) value = value + 0x34;
  1643.                  if (typeval == stereoeq) value = value + 0x1c;
  1644.                 Move(rp,  240,  70);
  1645.                 break;
  1646.               case VXFOUR_GADGET:
  1647.                 if (typeval == crossdelay)
  1648.                     {
  1649.                      inputt = input[value+2];
  1650.                      sprintf(inputtext,  "%2.2s",  inputt);
  1651.                      SetAPen(rp, 6);
  1652.                      SetBPen(rp, 7);
  1653.                      SetDrMd(rp,  INVERSVID|JAM2);
  1654.                      Move(rp,  55, 82);
  1655.                      Text(rp,  inputtext,  2);
  1656.                      SetAPen(rp,  2);
  1657.                      SetBPen(rp,  0);
  1658.                      SetDrMd(rp,  JAM2);
  1659.                     }
  1660.                 if (typeval == autopan)
  1661.                     {
  1662.                      pdirt = pdir[value];
  1663.                      sprintf(pdirtext,  "%4.4s",  pdirt);
  1664.                      SetAPen(rp, 6);
  1665.                      SetBPen(rp, 7);
  1666.                      SetDrMd(rp,  INVERSVID|JAM2);
  1667.                      Move(rp,  40, 82);
  1668.                      Text(rp,  pdirtext,  4);
  1669.                      SetAPen(rp,  2);
  1670.                      SetBPen(rp,  0);
  1671.                      SetDrMd(rp,  JAM2);
  1672.                     }
  1673.                 if ((typeval == karaoke1)|(typeval == karaoke2)|(typeval == karaoke3)) value = value + 0x22;
  1674.                 if (typeval == monoeq) value = value + 0x0a;
  1675.                 if (typeval == stereoeq) value = value + 0x34;
  1676.                 Move(rp,  240,  81);
  1677.                 break;
  1678.               case VXFIVE_GADGET:
  1679.                 if ((typeval == hall1)|(typeval == hall2)|(typeval == room1)|(typeval == room2)|(typeval == room3)|
  1680.                     (typeval == stage1)|(typeval == stage2)|(typeval == plate)) value = value + 0x22;
  1681.                 else if (typeval == monoeq) value = value + 0x34;
  1682.                 Move(rp,  240,  92);
  1683.                 break;
  1684.               case VXSIX_GADGET:
  1685.                 if ((typeval == chorus1)|(typeval == chorus2)|(typeval == chorus3)|(typeval == chorus4)|
  1686.                     (typeval == celeste1)|(typeval == celeste2)|(typeval == celeste3)|(typeval == celeste4)|
  1687.                     (typeval == flanger1)|(typeval == flanger2)|(typeval == flanger3)|(typeval == symphonic)|
  1688.                     (typeval == rotaryspeaker)|(typeval == tremolo)|(typeval == autopan)|
  1689.                     (typeval == phaser1)|(typeval == phaser2)) value = value + 0x08;
  1690.                  if (typeval == monoeq) value = value + 0x08;
  1691.                 Move(rp,  240,  103);
  1692.                 break;
  1693.               case VXSEVEN_GADGET:
  1694.                 if ((typeval == earlyrefl1)|(typeval == earlyrefl2)|
  1695.                     (typeval == gatereverb)|(typeval == reversegate)) value = value + 0x22;
  1696.                 if ((typeval == chorus1)|(typeval == chorus2)|(typeval == chorus3)|(typeval == chorus4)|
  1697.                     (typeval == celeste1)|(typeval == celeste2)|(typeval == celeste3)|(typeval == celeste4)|
  1698.                     (typeval == flanger1)|(typeval == flanger2)|(typeval == flanger3)|(typeval == symphonic)|
  1699.                     (typeval == rotaryspeaker)|(typeval == tremolo)|(typeval == autopan)|
  1700.                     (typeval == phaser1)|(typeval == phaser2)) value = value + 0x34;
  1701.                  if (typeval == monoeq) value = value + 0x1c;
  1702.                 Move(rp,  240,  114);
  1703.                 break;
  1704.               case VXEIGHT_GADGET:
  1705.                 if ((typeval == chorus1)|(typeval == chorus2)|(typeval == chorus3)|(typeval == chorus4)|
  1706.                     (typeval == celeste1)|(typeval == celeste2)|(typeval == celeste3)|(typeval == celeste4)|
  1707.                     (typeval == flanger1)|(typeval == flanger2)|(typeval == flanger3)|(typeval == symphonic)|
  1708.                     (typeval == rotaryspeaker)|(typeval == tremolo)|(typeval == autopan)|
  1709.                     (typeval == phaser1)|(typeval == phaser2)) value = value + 0x1c;
  1710.                 Move(rp,  240,  125);
  1711.                 break;
  1712.               case VXNINE_GADGET:
  1713.                 if ((typeval == chorus1)|(typeval == chorus2)|(typeval == chorus3)|(typeval == chorus4)|
  1714.                     (typeval == celeste1)|(typeval == celeste2)|(typeval == celeste3)|(typeval == celeste4)|
  1715.                     (typeval == flanger1)|(typeval == flanger2)|(typeval == flanger3)|(typeval == symphonic)|
  1716.                     (typeval == rotaryspeaker)|(typeval == tremolo)|(typeval == autopan)|
  1717.                     (typeval == phaser1)|(typeval == phaser2)) value = value + 0x34;
  1718.                 Move(rp,  240,  136);
  1719.                 break;
  1720.               case VXTEN_GADGET:
  1721.                 Move(rp,  240,  147);
  1722.                 break;
  1723.               case VXELEVEN_GADGET:
  1724.                 Move(rp,  240,  158);
  1725.                 break;
  1726.               case VXTWELVE_GADGET:
  1727.                 Move(rp,  240,  169);
  1728.                 break;
  1729.               case VXTHIRTEEN_GADGET:
  1730.                 Move(rp,  240,  180);
  1731.                 break;
  1732.               case VXFOURTEEN_GADGET:
  1733.                 Move(rp,  240,  191);
  1734.                 break;
  1735.               case VXFIFTEEN_GADGET:
  1736.                 if ((typeval == phaser1)|(typeval == phaser2)) value = value + 0x03;
  1737.                 Move(rp,  240,  202);
  1738.                 break;
  1739.               case VXSIXTEEN_GADGET:
  1740.                 Move(rp,  240,  213);
  1741.                 break;
  1742.               case VXSEVENTEEN_GADGET:
  1743.                 if ((typeval == delaylcr)|(typeval == delaylr)|(typeval == echo)|(typeval == crossdelay)) value = value + 0x08;
  1744.                 if ((typeval == phaser1)|(typeval == phaser2)) value = value + 0x04;
  1745.                 Move(rp,  240,  224);
  1746.                 break;
  1747.               case VXEIGHTEEN_GADGET:
  1748.                 if ((typeval == delaylcr)|(typeval == delaylr)|(typeval == echo)|(typeval == crossdelay)) value = value + 0x34;
  1749.                 if ((value == flanger1)|(value == flanger3))value = value + 0x04;
  1750.                 if (typeval == tremolo) value = value + 0x04;
  1751.                 Move(rp,  240,  235);
  1752.                 break;
  1753.               case VXNINETEEN_GADGET:
  1754.                 if  ((typeval == chorus1)|(typeval == chorus2)|(typeval == chorus3)|(typeval == chorus4)|
  1755.                     (typeval == celeste1)|(typeval == celeste2)|(typeval == celeste3)|(typeval == celeste4)|(typeval == tremolo))
  1756.                     {
  1757.                      inputt = input[value];
  1758.                      sprintf(inputtext,  "%2.2s",  inputt);
  1759.                      SetAPen(rp, 6);
  1760.                      SetBPen(rp, 7);
  1761.                      SetDrMd(rp,  INVERSVID|JAM2);
  1762.                      Move(rp,  55, 247);
  1763.                      Text(rp,  inputtext,  2);
  1764.                      SetAPen(rp,  2);
  1765.                      SetBPen(rp,  0);
  1766.                      SetDrMd(rp,  JAM2);
  1767.                     }
  1768.                 if ((typeval == delaylcr)|(typeval == delaylr)|(typeval == echo)|(typeval == crossdelay)) value = value + 0x1c;
  1769.                 Move(rp,  240,  246);
  1770.                 break;
  1771.               case VXTWENTY_GADGET:
  1772.                 if ((typeval == delaylcr)||(typeval == delaylr)||(typeval == echo)||(typeval == crossdelay)) value = value + 0x34;
  1773.                 Move(rp,  240,  257);
  1774.                 break;
  1775.               default:
  1776.                 break;
  1777.               }
  1778.   SetAPen(rp,  1);
  1779.   SetBPen(rp,  0);
  1780.   SetDrMd(rp,  JAM2);
  1781.   sprintf(text,  "%3ld",  value);
  1782.   Text(rp,  text,  3);
  1783.  
  1784.   return value;
  1785. }
  1786.  
  1787. //to hear the changes
  1788.  
  1789. static void send_note(struct VXXGTool *tool,  const long time,  const UBYTE note)
  1790. {
  1791.   struct NoteEvent *on_event = (struct NoteEvent *)(*functions->allocevent)();
  1792.   if (on_event)
  1793.     {
  1794.       struct NoteEvent *off_event = (struct NoteEvent *)(*functions->allocevent)();
  1795.       if (off_event)
  1796.         {
  1797.           on_event->next  =
  1798.           off_event->next = NULL;
  1799.  
  1800.           on_event->type  =
  1801.           off_event->type = EVENT_VOICE;
  1802.  
  1803.           on_event->status  = MIDI_NOTEON;
  1804.           off_event->status = MIDI_NOTEOFF;
  1805.  
  1806.           on_event->value  =
  1807.           off_event->value = note;
  1808.  
  1809.           on_event->velocity = 80;
  1810.  
  1811.           on_event->time  = time;
  1812.           off_event->time = time + 96;
  1813.  
  1814.           on_event->tool  =
  1815.           off_event->tool = tool->tool.next;
  1816.  
  1817.           (*functions->qevent)(on_event);
  1818.           (*functions->qevent)(off_event);
  1819.         }
  1820.       else
  1821.         {
  1822.           (*functions->freeevent)(on_event);
  1823.         }
  1824.     }
  1825. }
  1826.  
  1827.  
  1828.  
  1829. static void initvalues(struct Window *window, struct VXXGTool *tool, int init, UBYTE initswich)
  1830. {
  1831.   int i,a,b = init*20;
  1832. //initialvalues for the sliders
  1833.  UBYTE initval[]={
  1834. // 42   44   46   48   4a   4c   4e   50   52   54   56   57   58   59   70   71   72   73   74   75
  1835.    0x12,0x0a,0x08,0x0d,0x0f,0x00,0x00,0x00,0x00,0x28,0x40,0x40,0x00,0x00,0x00,0x04,0x32,0x40,0x40,0x00,    //Hall1
  1836.    0x19,0x0a,0x1c,0x06,0x0c,0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x00,0x0d,0x03,0x4a,0x40,0x40,0x00,    //Hall2
  1837.    0x05,0x0a,0x10,0x04,0x0f,0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x00,0x05,0x03,0x40,0x40,0x40,0x00,    //Room1
  1838.    0x0c,0x0a,0x05,0x04,0x04,0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0x03,0x32,0x40,0x40,0x00,    //Room2
  1839.    0x09,0x0a,0x2f,0x05,0x02,0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x00,0x00,0x03,0x3c,0x40,0x40,0x00,    //Room3
  1840.  
  1841.    0x13,0x0a,0x10,0x07,0x14,0x00,0x00,0x00,0x00,0x28,0x40,0x40,0x00,0x00,0x00,0x03,0x40,0x40,0x40,0x00,    //Stage1
  1842.    0x0b,0x0a,0x10,0x07,0x11,0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x00,0x02,0x02,0x40,0x40,0x40,0x00,    //Stage2
  1843.    0x19,0x0a,0x06,0x08,0x0f,0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x00,0x02,0x03,0x40,0x40,0x40,0x00,    //Plate
  1844.  
  1845.    0x1a,0x0d,0x27,0x27,0x4a,0x64,0x0a,0x00,0x00,0x20,0x40,0x40,0x00,0x00,0x00,0x00,0x14,0x0c,0x12,0x0c,    //Delay LCR
  1846.    0x13,0x1d,0x1d,0x1d,0x57,0x0a,0x00,0x00,0x00,0x20,0x40,0x40,0x00,0x00,0x00,0x00,0x14,0x0c,0x12,0x0c,    //Delay LR
  1847.    0x0d,0x50,0x0d,0x50,0x0a,0x0d,0x0d,0x00,0x00,0x28,0x40,0x40,0x00,0x00,0x00,0x00,0x14,0x0c,0x12,0x0c,    //Echo
  1848.    0x0d,0x0d,0x6f,0x01,0x0a,0x00,0x00,0x00,0x00,0x20,0x40,0x40,0x00,0x00,0x00,0x00,0x14,0x0c,0x12,0x0c,    //Cross Delay
  1849.  
  1850.    0x00,0x13,0x05,0x10,0x40,0x00,0x0c,0x00,0x00,0x20,0x40,0x40,0x00,0x00,0x05,0x00,0x04,0x00,0x00,0x00,    //Early Reflection 1
  1851.    0x00,0x13,0x05,0x10,0x40,0x00,0x0c,0x00,0x00,0x20,0x40,0x40,0x00,0x00,0x05,0x00,0x04,0x00,0x00,0x00,    //Early Reflection 2
  1852.  
  1853.    0x00,0x0f,0x06,0x02,0x40,0x00,0x0a,0x00,0x00,0x20,0x40,0x40,0x00,0x00,0x04,0x03,0x0a,0x00,0x00,0x00,    //Gate Reverb
  1854.    0x00,0x0f,0x06,0x02,0x40,0x00,0x0d,0x00,0x00,0x20,0x40,0x40,0x00,0x00,0x04,0x03,0x0a,0x00,0x00,0x00,    //Reverse Gate
  1855.  
  1856.    0x3f,0x61,0x00,0x0e,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Karaoke 1
  1857.    0x37,0x69,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Karaoke 2
  1858.    0x2b,0x6e,0x0e,0x13,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Karaoke 3
  1859.  
  1860.    0x06,0x36,0x4d,0x6a,0x00,0x14,0x0c,0x12,0x0c,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Chorus 1
  1861.    0x08,0x3f,0x40,0x1e,0x00,0x14,0x0a,0x0e,0x06,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Chorus 2
  1862.    0x04,0x2c,0x40,0x6e,0x00,0x14,0x0c,0x12,0x0e,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Chorus 3
  1863.    0x07,0x20,0x45,0x68,0x00,0x14,0x0c,0x12,0x0c,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Chorus 4
  1864.  
  1865.    0x0c,0x20,0x40,0x00,0x00,0x14,0x0c,0x12,0x0c,0x7f,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Celeste 1
  1866.    0x1c,0x12,0x5a,0x02,0x00,0x14,0x0a,0x0e,0x08,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Celeste 2
  1867.    0x04,0x3f,0x2c,0x02,0x00,0x14,0x0c,0x12,0x10,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Celeste 3
  1868.    0x07,0x1d,0x40,0x00,0x00,0x14,0x0c,0x17,0x0e,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,    //Celeste 4
  1869. // 42   44   46   48   4a   4c   4e   50   52   54   56   57   58   59   70   71   72   73   74   75
  1870.    0x0e,0x0e,0x68,0x02,0x00,0x14,0x0c,0x12,0x0c,0x60,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Flanger 1
  1871.    0x20,0x11,0x1a,0x02,0x00,0x14,0x0c,0x12,0x08,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Flanger 2
  1872.    0x03,0x6d,0x6d,0x02,0x00,0x14,0x0c,0x12,0x0c,0x60,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Flanger 3
  1873.  
  1874.    0x0c,0x19,0x10,0x00,0x00,0x1c,0x0c,0x12,0x0c,0x7f,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Symphonic
  1875.    0x51,0x23,0x00,0x00,0x00,0x18,0x08,0x11,0x02,0x7f,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Rotary Speaker
  1876.    0x53,0x38,0x00,0x00,0x00,0x1c,0x08,0x12,0x0c,0x00,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,    //Tremolo
  1877.    0x4c,0x50,0x20,0x05,0x00,0x1c,0x0c,0x12,0x0c,0x00,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Auto Pan
  1878.  
  1879.    0x08,0x6f,0x4a,0x68,0x00,0x14,0x0c,0x12,0x0c,0x40,0x40,0x40,0x00,0x00,0x06,0x01,0x40,0x00,0x00,0x00,    //Phaser 1
  1880.    0x08,0x6f,0x4a,0x6c,0x00,0x14,0x0c,0x12,0x0c,0x40,0x00,0x00,0x00,0x00,0x05,0x01,0x04,0x00,0x00,0x00,    //Phaser 1
  1881.  
  1882.    0x28,0x0c,0x14,0x13,0x30,0x00,0x0f,0x16,0x00,0x7f,0x40,0x40,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,    //Distortion
  1883.    0x1d,0x10,0x10,0x0b,0x37,0x00,0x0d,0x14,0x00,0x7f,0x00,0x00,0x00,0x00,0x68,0x00,0x00,0x00,0x00,0x00,    //Overdrive
  1884.  
  1885.    0x27,0x01,0x0e,0x2d,0x37,0x00,0x00,0x00,0x00,0x7f,0x40,0x40,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,    //Guitar Amp
  1886.  
  1887.    0x46,0x38,0x27,0x0f,0x00,0x14,0x0e,0x13,0x0c,0x7f,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //Auto Wah
  1888.  
  1889.    0x12,0x06,0x08,0x00,0x12,0x14,0x12,0x00,0x00,0x00,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,    //3-Band Equalizer (mono)
  1890.    0x14,0x12,0x12,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 };  //2-Band Equalizer (stereo)
  1891.  
  1892. //rangevalues for the sliders
  1893.   UBYTE range[]={
  1894.  // 42   44   46   48   4a   4c   4e   50   52   54   56   57   58   59   70   71   72   73   74   75
  1895.    0x46,0x0b,0x40,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x05,0x80,0x80,0x80,0x80,    //Hall1
  1896.    0x46,0x0b,0x40,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x05,0x80,0x80,0x80,0x80,    //Hall2
  1897.    0x46,0x0b,0x40,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x05,0x80,0x80,0x80,0x80,    //Room1
  1898.    0x46,0x0b,0x40,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x05,0x80,0x80,0x80,0x80,    //Room2
  1899.    0x46,0x0b,0x40,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x05,0x80,0x80,0x80,0x80,    //Room3
  1900.    0x46,0x0b,0x40,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x05,0x80,0x80,0x80,0x80,    //Stage1
  1901.    0x46,0x0b,0x40,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x05,0x80,0x80,0x80,0x80,    //Stage2
  1902.    0x46,0x0b,0x40,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x40,0x05,0x80,0x80,0x80,0x80,    //Plate
  1903.  
  1904.    0x80,0x80,0x80,0x80,0x80,0x80,0x0a,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,    //Delay LCR
  1905.    0x80,0x80,0x80,0x80,0x80,0x0a,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,    //Delay LR
  1906.    0x80,0x80,0x80,0x80,0x0a,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,    //Echo
  1907.    0x80,0x80,0x80,0x03,0x80,0x0a,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,    //Cross Delay
  1908.  
  1909.    0x06,0x2d,0x0b,0x40,0x80,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0b,0x04,0x0a,0x80,0x80,0x80,    //Early Reflection 1
  1910.    0x06,0x2d,0x0b,0x40,0x80,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0b,0x04,0x0a,0x80,0x80,0x80,    //Early Reflection 2
  1911.  
  1912.    0x02,0x2d,0x0b,0x40,0x80,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0b,0x04,0x0a,0x80,0x80,0x80,    //Gate Reverb
  1913.    0x02,0x2d,0x0b,0x40,0x80,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x0b,0x04,0x0a,0x80,0x80,0x80,    //Reverse Gate
  1914.  
  1915.    0x80,0x80,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,    //Karaoke 1
  1916.    0x80,0x80,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,    //Karaoke 2
  1917.    0x80,0x80,0x35,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,    //Karaoke 3
  1918.  
  1919.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x02,0x80,    //Chorus 1
  1920.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x02,0x80,    //Chorus 2
  1921.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x02,0x80,    //Chorus 3
  1922.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x02,0x80,    //Chorus 4
  1923.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x02,0x80,    //Celeste 1
  1924.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x02,0x80,    //Celeste 2
  1925.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x02,0x80,    //Celeste 3
  1926.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x02,0x80,    //Celeste 1
  1927.  
  1928.    0x80,0x80,0x80,0x40,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x78,0x80,0x80,    //Flanger 1
  1929.    0x80,0x80,0x80,0x40,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x78,0x80,0x80,    //Flanger 2
  1930.    0x80,0x80,0x80,0x40,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x78,0x80,0x80,    //Flanger 3
  1931.  
  1932.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,    //Symphonic
  1933.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,    //Rotary Speaker
  1934.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x78,0x02,0x80,    //Tremolo
  1935.    0x80,0x80,0x80,0x06,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,    //Auto Pan
  1936.  
  1937.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x07,0x07,0x78,0x80,0x80,0x80,    //Phaser 1
  1938.    0x80,0x80,0x80,0x80,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x07,0x07,0x78,0x80,0x80,0x80,    //Phaser 2
  1939.  
  1940.    0x80,0x21,0x19,0x1b,0x80,0x80,0x1b,0x19,0x6e,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,    //Distortion
  1941.    0x80,0x21,0x19,0x1b,0x80,0x80,0x1b,0x19,0x6e,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,    //Overdrive
  1942.  
  1943.    0x80,0x04,0x1b,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,    //Guitar Amp
  1944.    0x80,0x80,0x80,0x6e,0x80,0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,    //Auto Wah
  1945.    0x19,0x1f,0x21,0x6e,0x19,0x21,0x1f,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,    //3-Band Equalizer (mono)
  1946.    0x21,0x19,0x1f,0x19,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80};   //2-Band Equalizer (stereo)
  1947.  
  1948.  if (initswich == 1)
  1949.   {
  1950.     tool->vrfxone       = initval[0+b];
  1951.     tool->vrfxtwo       = initval[1+b];
  1952.     tool->vrfxthree     = initval[2+b];
  1953.     tool->vrfxfour      = initval[3+b];
  1954.     tool->vrfxfive      = initval[4+b];
  1955.     tool->vrfxsix       = initval[5+b];
  1956.     tool->vrfxseven     = initval[6+b];
  1957.     tool->vrfxeight     = initval[7+b];
  1958.     tool->vrfxnine      = initval[8+b];
  1959.     tool->vrfxten       = initval[9+b];
  1960.     tool->vrfxeleven    = initval[10+b];
  1961.     tool->vrfxtwelve    = initval[11+b];
  1962.     tool->vrfxthirteen  = initval[12+b];
  1963.     tool->vrfxfourteen  = initval[13+b];
  1964.     tool->vrfxfifteen   = initval[14+b];
  1965.     tool->vrfxsixteen   = initval[15+b];
  1966.     tool->vrfxseventeen = initval[16+b];
  1967.     tool->vrfxeighteen  = initval[17+b];
  1968.     tool->vrfxnineteen  = initval[18+b];
  1969.     tool->vrfxtwenty    = initval[19+b];
  1970.   }
  1971.  
  1972.  (*functions->ModifyEmbossedProp)(window,  VXONE_GADGET,        (LONG)tool->vrfxone,      0,  (LONG)range[0+b],  0,  0,  0);
  1973.  (*functions->ModifyEmbossedProp)(window,  VXTWO_GADGET,        (LONG)tool->vrfxtwo,      0,  (LONG)range[1+b],  0,  0,  0);
  1974.  (*functions->ModifyEmbossedProp)(window,  VXTHREE_GADGET,      (LONG)tool->vrfxthree,    0,  (LONG)range[2+b],  0,  0,  0);
  1975.  (*functions->ModifyEmbossedProp)(window,  VXFOUR_GADGET,       (LONG)tool->vrfxfour,     0,  (LONG)range[3+b],  0,  0,  0);
  1976.  (*functions->ModifyEmbossedProp)(window,  VXFIVE_GADGET,       (LONG)tool->vrfxfive,     0,  (LONG)range[4+b],  0,  0,  0);
  1977.  (*functions->ModifyEmbossedProp)(window,  VXSIX_GADGET,        (LONG)tool->vrfxsix,      0,  (LONG)range[5+b],  0,  0,  0);
  1978.  (*functions->ModifyEmbossedProp)(window,  VXSEVEN_GADGET,      (LONG)tool->vrfxseven,    0,  (LONG)range[6+b],  0,  0,  0);
  1979.  (*functions->ModifyEmbossedProp)(window,  VXEIGHT_GADGET,      (LONG)tool->vrfxeight,    0,  (LONG)range[7+b],  0,  0,  0);
  1980.  (*functions->ModifyEmbossedProp)(window,  VXNINE_GADGET,       (LONG)tool->vrfxnine,     0,  (LONG)range[8+b],  0,  0,  0);
  1981.  (*functions->ModifyEmbossedProp)(window,  VXTEN_GADGET,        (LONG)tool->vrfxten,      0,  (LONG)range[9+b],  0,  0,  0);
  1982.  (*functions->ModifyEmbossedProp)(window,  VXELEVEN_GADGET,     (LONG)tool->vrfxeleven,   0,  (LONG)range[10+b],  0,  0,  0);
  1983.  (*functions->ModifyEmbossedProp)(window,  VXTWELVE_GADGET,     (LONG)tool->vrfxtwelve,   0,  (LONG)range[11+b],  0,  0,  0);
  1984.  (*functions->ModifyEmbossedProp)(window,  VXTHIRTEEN_GADGET,   (LONG)tool->vrfxthirteen, 0,  (LONG)range[12+b],  0,  0,  0);
  1985.  (*functions->ModifyEmbossedProp)(window,  VXFOURTEEN_GADGET,   (LONG)tool->vrfxfourteen, 0,  (LONG)range[13+b],  0,  0,  0);
  1986.  (*functions->ModifyEmbossedProp)(window,  VXFIFTEEN_GADGET,    (LONG)tool->vrfxfifteen,  0,  (LONG)range[14+b],  0,  0,  0);
  1987.  (*functions->ModifyEmbossedProp)(window,  VXSIXTEEN_GADGET,    (LONG)tool->vrfxsixteen,  0,  (LONG)range[15+b],  0,  0,  0);
  1988.  (*functions->ModifyEmbossedProp)(window,  VXSEVENTEEN_GADGET,  (LONG)tool->vrfxseventeen,0,  (LONG)range[16+b],  0,  0,  0);
  1989.  (*functions->ModifyEmbossedProp)(window,  VXEIGHTEEN_GADGET,   (LONG)tool->vrfxeighteen, 0,  (LONG)range[17+b],  0,  0,  0);
  1990.  (*functions->ModifyEmbossedProp)(window,  VXNINETEEN_GADGET,   (LONG)tool->vrfxnineteen, 0,  (LONG)range[18+b],  0,  0,  0);
  1991.  (*functions->ModifyEmbossedProp)(window,  VXTWENTY_GADGET,     (LONG)tool->vrfxtwenty,   0,  (LONG)range[19+b],  0,  0,  0);
  1992.  
  1993.  
  1994.     for  (i = VXONE_GADGET; i<=VXTWENTY_GADGET; i +=3)
  1995.         {
  1996.           (*functions->DrawEmbossedProp)(window,  i);
  1997.         }
  1998. }
  1999.  
  2000.  
  2001. //the center off all
  2002.  
  2003. static void __saveds edittoolcode(struct VXXGTool *tool)
  2004. {
  2005.   struct IntuiMessage *message;
  2006.   struct Window *window;
  2007.   LONG class,  code,  time;
  2008.   struct Gadget *gadget;
  2009.   struct NewWindow *newwindow;
  2010.   int i,  ini, vrfxres=0;
  2011.   UBYTE MS, LS;
  2012.   char *storagebt, *MSB;
  2013.  
  2014.  
  2015.  
  2016.  
  2017.   VXXGNewWindowStructure1.Screen = functions->screen;
  2018.  
  2019.   if (tool->tool.touched & TOUCH_EDIT)
  2020.     {
  2021.       VXXGNewWindowStructure1.LeftEdge = tool->tool.left;
  2022.       VXXGNewWindowStructure1.TopEdge = tool->tool.top;
  2023.       VXXGNewWindowStructure1.Width = tool->tool.width;
  2024.       VXXGNewWindowStructure1.Height = tool->tool.height;
  2025.       tool->typesysex         = tool->storage1;
  2026.       tool->onesysex          = tool->storage2;
  2027.       tool->twosysex          = tool->storage3;
  2028.       tool->threesysex        = tool->storage4;
  2029.       tool->foursysex         = tool->storage5;
  2030.       tool->fivesysex         = tool->storage6;
  2031.       tool->sixsysex          = tool->storage7;
  2032.       tool->sevensysex        = tool->storage8;
  2033.       tool->eightsysex        = tool->storage9;
  2034.       tool->ninesysex         = tool->storage10;
  2035.       tool->tensysex          = tool->storage11;
  2036.       tool->elevensysex       = tool->storage12;
  2037.       tool->twelvesysex       = tool->storage13;
  2038.       tool->thirteensysex     = tool->storage14;
  2039.       tool->fourteensysex     = tool->storage15;
  2040.       tool->fifteensysex      = tool->storage16;
  2041.       tool->sixteensysex      = tool->storage17;
  2042.       tool->seventeensysex    = tool->storage18;
  2043.       tool->eighteensysex     = tool->storage19;
  2044.       tool->nineteensysex     = tool->storage20;
  2045.       tool->twentysysex       = tool->storage21;
  2046.     }
  2047.   
  2048.   if (!tool->tool.touched)
  2049.     {
  2050.       VXXG_tool_init(tool);
  2051.     }
  2052.  
  2053.   newwindow = (struct NewWindow *) (*functions->DupeNewWindow)(&VXXGNewWindowStructure1);
  2054.   if (!newwindow)
  2055.     {
  2056.       return;
  2057.     }
  2058.   newwindow->Title = 0;
  2059.   newwindow->Flags |= BORDERLESS;
  2060.   newwindow->Flags &= ~0xF;
  2061.   newwindow->BlockPen = 0;
  2062.   newwindow->DetailPen = 0;
  2063.  
  2064.   window = (struct Window *) (*functions->FlashyOpenWindow)(newwindow);
  2065.   if (!window) return;
  2066.  
  2067.   tool->tool.window = window;
  2068.   (*functions->EmbossWindowOn)(window, WINDOWCLOSE|WINDOWDEPTH|WINDOWDRAG,  VXXG_NAME, (short)-1, (short)-1, 0, 0);
  2069.  
  2070.   (*functions->FatEmbossedPropOn)(window,  VXTYPE_GADGET,  VXTYPEDOWN_GADGET,
  2071.                                  VXTYPEUP_GADGET, (void *)display_routine,  42,  1);
  2072.  
  2073.   (*functions->FatEmbossedPropOn)(window,  VXONE_GADGET,  VXONEDOWN_GADGET,
  2074.                                   VXONEUP_GADGET, (void *)display_routine,  128,  1);
  2075.  
  2076.   (*functions->FatEmbossedPropOn)(window,  VXTWO_GADGET,  VXTWODOWN_GADGET,
  2077.                                   VXTWOUP_GADGET, (void *)display_routine,  128,  1);
  2078.  
  2079.   (*functions->FatEmbossedPropOn)(window,  VXTHREE_GADGET,  VXTHREEDOWN_GADGET,
  2080.                                   VXTHREEUP_GADGET, (void *)display_routine,  128,  1);
  2081.  
  2082.   (*functions->FatEmbossedPropOn)(window,  VXFOUR_GADGET,  VXFOURDOWN_GADGET,
  2083.                                   VXFOURUP_GADGET, (void *)display_routine,  128,  1);
  2084.  
  2085.   (*functions->FatEmbossedPropOn)(window,  VXFIVE_GADGET,  VXFIVEDOWN_GADGET,
  2086.                                   VXFIVEUP_GADGET, (void *)display_routine, 128,  1);
  2087.  
  2088.   (*functions->FatEmbossedPropOn)(window,  VXSIX_GADGET,  VXSIXDOWN_GADGET,
  2089.                                   VXSIXUP_GADGET, (void *)display_routine, 128,  1);
  2090.  
  2091.   (*functions->FatEmbossedPropOn)(window,  VXSEVEN_GADGET,  VXSEVENDOWN_GADGET,
  2092.                                   VXSEVENUP_GADGET, (void *)display_routine, 128,  1);
  2093.  
  2094.   (*functions->FatEmbossedPropOn)(window,  VXEIGHT_GADGET,  VXEIGHTDOWN_GADGET,
  2095.                                   VXEIGHTUP_GADGET, (void *)display_routine, 128,  1);
  2096.  
  2097.   (*functions->FatEmbossedPropOn)(window,  VXNINE_GADGET,  VXNINEDOWN_GADGET,
  2098.                                   VXNINEUP_GADGET, (void *)display_routine, 128,  1);
  2099.  
  2100.   (*functions->FatEmbossedPropOn)(window,  VXTEN_GADGET,  VXTENDOWN_GADGET,
  2101.                                   VXTENUP_GADGET, (void *)display_routine,  128,  1);
  2102.  
  2103.   (*functions->FatEmbossedPropOn)(window,  VXELEVEN_GADGET,  VXELEVENDOWN_GADGET,
  2104.                                   VXELEVENUP_GADGET, (void *)display_routine,  128,  1);
  2105.  
  2106.   (*functions->FatEmbossedPropOn)(window,  VXTWELVE_GADGET,  VXTWELVEDOWN_GADGET,
  2107.                                   VXTWELVEUP_GADGET, (void *)display_routine,  128,  1);
  2108.  
  2109.   (*functions->FatEmbossedPropOn)(window,  VXTHIRTEEN_GADGET,  VXTHIRTEENDOWN_GADGET,
  2110.                                   VXTHIRTEENUP_GADGET, (void *)display_routine, 128,  1);
  2111.  
  2112.   (*functions->FatEmbossedPropOn)(window,  VXFOURTEEN_GADGET,  VXFOURTEENDOWN_GADGET,
  2113.                                   VXFOURTEENUP_GADGET, (void *)display_routine, 128, 1);
  2114.  
  2115.   (*functions->FatEmbossedPropOn)(window,  VXFIFTEEN_GADGET,  VXFIFTEENDOWN_GADGET,
  2116.                                   VXFIFTEENUP_GADGET, (void *)display_routine,  128,  1);
  2117.  
  2118.   (*functions->FatEmbossedPropOn)(window,  VXSIXTEEN_GADGET,  VXSIXTEENDOWN_GADGET,
  2119.                                   VXSIXTEENUP_GADGET, (void *)display_routine,  128,  1);
  2120.  
  2121.   (*functions->FatEmbossedPropOn)(window,  VXSEVENTEEN_GADGET,  VXSEVENTEENDOWN_GADGET,
  2122.                                   VXSEVENTEENUP_GADGET, (void *)display_routine,  128,  1);
  2123.  
  2124.   (*functions->FatEmbossedPropOn)(window,  VXEIGHTEEN_GADGET,  VXEIGHTEENDOWN_GADGET,
  2125.                                   VXEIGHTEENUP_GADGET, (void *)display_routine,  128,  1);
  2126.  
  2127.   (*functions->FatEmbossedPropOn)(window,  VXNINETEEN_GADGET,  VXNINETEENDOWN_GADGET,
  2128.                                   VXNINETEENUP_GADGET, (void *)display_routine,  128,  1);
  2129.  
  2130.   (*functions->FatEmbossedPropOn)(window,  VXTWENTY_GADGET,  VXTWENTYDOWN_GADGET,
  2131.                                   VXTWENTYUP_GADGET, (void *)display_routine,  128,  1);
  2132.  
  2133.   (*functions->EmbossOn)(window,  WRITE_GADGET,  1);
  2134.  
  2135.   (*functions->ModifyEmbossedProp)(window,  VXTYPE_GADGET,  (LONG)tool->vrfxtype,  0,  0,  0,  0,  0);
  2136.   (*functions->DrawEmbossedProp)(window,  VXTYPE_GADGET);
  2137.   ini = (int)tool->vrfxtype;
  2138.   initvalues(window, tool, ini, 0);
  2139.  
  2140.   send_note(tool,  functions->timenow,  60);
  2141.  
  2142.   for (;;)
  2143.     {
  2144.  
  2145.       message = (struct IntuiMessage *) (*functions->GetIntuiMessage)(window);
  2146.       class = message->Class;
  2147.       code = message->Code;
  2148.       gadget = (struct Gadget *) message->IAddress;
  2149.       class = (*functions->SystemGadgets)(window, class, gadget, code);
  2150.  
  2151.       ReplyMsg((struct Message *)message);
  2152.  
  2153.  
  2154.       if (class == CLOSEWINDOW)
  2155.         {
  2156.           break;
  2157.         }
  2158.       else if (class == GADGETDOWN)
  2159.         {
  2160.           const short id = gadget->GadgetID;
  2161.           time = functions->timenow;
  2162.           switch (id)
  2163.             {
  2164.             case VXTYPE_GADGET:
  2165.               tool->vrfxtype = (UBYTE) (*functions->DragEmbossedProp)(window,  VXTYPE_GADGET);
  2166.               typeval = tool->vrfxtype;
  2167.               sprintf(tool->storage1, "F043104C020140%.4sF7",typehexstr[tool->vrfxtype]);
  2168.               tool->typesysex = tool->storage1;
  2169.               transsysex(tool,  time,  tool->typesysex, 1);
  2170.               ini = (int)tool->vrfxtype;
  2171.               initvalues(window, tool, ini, 1);
  2172.               break;
  2173.             case VXTYPEDOWN_GADGET:
  2174.               tool->vrfxtype = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTYPE_GADGET,  -1,  0);
  2175.               typeval = tool->vrfxtype;
  2176.               sprintf(tool->storage1, "F043104C020140%.4sF7",typehexstr[tool->vrfxtype]);
  2177.               tool->typesysex = tool->storage1;
  2178.               transsysex(tool,  time,  tool->typesysex, 1);
  2179.               ini = (int)tool->vrfxtype;
  2180.               initvalues(window, tool, ini, 1);
  2181.               break;
  2182.             case VXTYPEUP_GADGET:
  2183.               tool->vrfxtype = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTYPE_GADGET,  1,  0);
  2184.               typeval = tool->vrfxtype;
  2185.               sprintf(tool->storage1, "F043104C020140%.4sF7",typehexstr[tool->vrfxtype]);
  2186.               tool->typesysex = tool->storage1;
  2187.               transsysex(tool,  time,  tool->typesysex,1);
  2188.               ini = (int)tool->vrfxtype;
  2189.               initvalues(window, tool, ini, 1);
  2190.               break;
  2191.             case VXONE_GADGET:
  2192.               tool->vrfxone = (UBYTE) (*functions->DragEmbossedProp)(window,  VXONE_GADGET);
  2193.               if ((tool->vrfxtype < 8)|(tool->vrfxtype > 11))
  2194.                   {
  2195.                   MS = 0;
  2196.                   LS = tool->vrfxone;
  2197.                   }
  2198.               if (tool->vrfxtype == 8)
  2199.                   {
  2200.                   MS = tool->vrfxone;
  2201.                   LS = 0x05;
  2202.                   }
  2203.               if (tool->vrfxtype == 9)
  2204.                   {
  2205.                   MS = tool->vrfxone;
  2206.                   LS = 0x44;
  2207.                   }
  2208.               if ((tool->vrfxtype == 10)|(tool->vrfxtype == 11))
  2209.                   {
  2210.                   MS = tool->vrfxone;
  2211.                   LS = 0x24;
  2212.                   }
  2213.               sprintf(tool->storage2, "F043104C020142%02lx%02lxF7",MS,LS);
  2214.               tool->onesysex = tool->storage2;
  2215.               transsysex(tool,  time,  tool->onesysex,1);
  2216.               break;
  2217.             case VXONEDOWN_GADGET:
  2218.               tool->vrfxone = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXONE_GADGET,  -1,  0);
  2219.               if ((tool->vrfxtype < 8)|(tool->vrfxtype > 11))
  2220.                   {
  2221.                   MS = 0;
  2222.                   LS = tool->vrfxone;
  2223.                   }
  2224.               if (tool->vrfxtype == 8)
  2225.                   {
  2226.                   MS = tool->vrfxone;
  2227.                   LS = 0x05;
  2228.                   }
  2229.               if (tool->vrfxtype == 9)
  2230.                   {
  2231.                   MS = tool->vrfxone;
  2232.                   LS = 0x44;
  2233.                   }
  2234.               if ((tool->vrfxtype == 10)|(tool->vrfxtype == 11))
  2235.                   {
  2236.                   MS = tool->vrfxone;
  2237.                   LS = 0x24;
  2238.                   }
  2239.               sprintf(tool->storage2, "F043104C020142%02lx%02lxF7",MS,LS);
  2240.               tool->onesysex = tool->storage2;
  2241.               transsysex(tool,  time,  tool->onesysex,1);
  2242.               break;
  2243.             case VXONEUP_GADGET:
  2244.               tool->vrfxone = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXONE_GADGET,  1,  0);
  2245.               if ((tool->vrfxtype < 8)|(tool->vrfxtype > 11))
  2246.                   {
  2247.                   MS = 0;
  2248.                   LS = tool->vrfxone;
  2249.                   }
  2250.               if (tool->vrfxtype == 8)
  2251.                   {
  2252.                   MS = tool->vrfxone;
  2253.                   LS = 0x05;
  2254.                   }
  2255.               if (tool->vrfxtype == 9)
  2256.                   {
  2257.                   MS = tool->vrfxone;
  2258.                   LS = 0x44;
  2259.                   }
  2260.               if ((tool->vrfxtype == 10)|(tool->vrfxtype == 11))
  2261.                   {
  2262.                   MS = tool->vrfxone;
  2263.                   LS = 0x24;
  2264.                   }
  2265.               sprintf(tool->storage2, "F043104C020142%02lx%02lxF7",MS,LS);
  2266.               tool->onesysex = tool->storage2;
  2267.               transsysex(tool,  time,  tool->onesysex,1);
  2268.               break;
  2269.             case VXTWO_GADGET:
  2270.               tool->vrfxtwo = (UBYTE) (*functions->DragEmbossedProp)(window,  VXTWO_GADGET);
  2271.               if ((tool->vrfxtype < 8)|(tool->vrfxtype > 11))
  2272.                   {
  2273.                   MS = 0;
  2274.                   LS = tool->vrfxtwo;
  2275.                   }
  2276.               if (tool->vrfxtype == 8)
  2277.                   {
  2278.                   MS = tool->vrfxtwo;
  2279.                   LS = 0x03;
  2280.                   }
  2281.               if (tool->vrfxtype == 9)
  2282.                   {
  2283.                   MS = tool->vrfxtwo;
  2284.                   LS = 0x26;
  2285.                   }
  2286.               if (tool->vrfxtype == 10)
  2287.                   {
  2288.                   MS = 0;
  2289.                   LS = tool->vrfxtwo;
  2290.                   }
  2291.               if (tool->vrfxtype == 11)
  2292.                   {
  2293.                   MS = tool->vrfxtwo;
  2294.                   LS = 0x56;
  2295.                   }
  2296.               sprintf(tool->storage3, "F043104C020144%02lx%02lxF7",MS,LS);
  2297.               tool->twosysex = tool->storage3;
  2298.               transsysex(tool,  time,  tool->twosysex,1);
  2299.               break;
  2300.             case VXTWODOWN_GADGET:
  2301.               tool->vrfxtwo = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTWO_GADGET,  -1,  0);
  2302.               if ((tool->vrfxtype < 8)|(tool->vrfxtype > 11))
  2303.                   {
  2304.                   MS = 0;
  2305.                   LS = tool->vrfxtwo;
  2306.                   }
  2307.               if (tool->vrfxtype == 8)
  2308.                   {
  2309.                   MS = tool->vrfxtwo;
  2310.                   LS = 0x03;
  2311.                   }
  2312.               if (tool->vrfxtype == 9)
  2313.                   {
  2314.                   MS = tool->vrfxtwo;
  2315.                   LS = 0x26;
  2316.                   }
  2317.               if (tool->vrfxtype == 10)
  2318.                   {
  2319.                   MS = 0;
  2320.                   LS = tool->vrfxtwo;
  2321.                   }
  2322.               if (tool->vrfxtype == 11)
  2323.                   {
  2324.                   MS = tool->vrfxtwo;
  2325.                   LS = 0x56;
  2326.                   }
  2327.               sprintf(tool->storage3, "F043104C020144%02lx%02lxF7",MS,LS);
  2328.               tool->twosysex = tool->storage3;
  2329.               transsysex(tool,  time,  tool->twosysex,1);
  2330.               break;
  2331.             case VXTWOUP_GADGET:
  2332.               tool->vrfxtwo = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTWO_GADGET,  1,  0);
  2333.               if ((tool->vrfxtype < 8)|(tool->vrfxtype > 11))
  2334.                   {
  2335.                   MS = 0;
  2336.                   LS = tool->vrfxtwo;
  2337.                   }
  2338.               if (tool->vrfxtype == 8)
  2339.                   {
  2340.                   MS = tool->vrfxtwo;
  2341.                   LS = 0x03;
  2342.                   }
  2343.               if (tool->vrfxtype == 9)
  2344.                   {
  2345.                   MS = tool->vrfxtwo;
  2346.                   LS = 0x26;
  2347.                   }
  2348.               if (tool->vrfxtype == 10)
  2349.                   {
  2350.                   MS = 0;
  2351.                   LS = tool->vrfxtwo;
  2352.                   }
  2353.               if (tool->vrfxtype == 11)
  2354.                   {
  2355.                   MS = tool->vrfxtwo;
  2356.                   LS = 0x56;
  2357.                   }
  2358.               sprintf(tool->storage3, "F043104C020144%02lx%02lxF7",MS,LS);
  2359.               tool->twosysex = tool->storage3;
  2360.               transsysex(tool,  time,  tool->twosysex,1);
  2361.               break;
  2362.             case VXTHREE_GADGET:
  2363.               tool->vrfxthree = (UBYTE) (*functions->DragEmbossedProp)(window,  VXTHREE_GADGET);
  2364.               if ((tool->vrfxtype < 8)|(tool->vrfxtype > 11))
  2365.                   {
  2366.                   MS = 0;
  2367.                   LS = tool->vrfxthree;
  2368.                   }
  2369.               if (tool->vrfxtype == 8)
  2370.                   {
  2371.                   MS = tool->vrfxthree;
  2372.                   LS = 0x08;
  2373.                   }
  2374.               if (tool->vrfxtype == 9)
  2375.                   {
  2376.                   MS = tool->vrfxthree;
  2377.                   LS = 0x28;
  2378.                   }
  2379.               if (tool->vrfxtype == 10)
  2380.                   {
  2381.                   MS = tool->vrfxthree;
  2382.                   LS = 0x74;
  2383.                   }
  2384.               if (tool->vrfxtype == 11)
  2385.                   {
  2386.                   MS = 0;
  2387.                   LS = tool->vrfxthree;
  2388.                   }
  2389.               sprintf(tool->storage4, "F043104C020146%02lx%02lxF7",MS,LS);
  2390.               tool->threesysex = tool->storage4;
  2391.               transsysex(tool,  time,  tool->threesysex,1);
  2392.               break;
  2393.             case VXTHREEDOWN_GADGET:
  2394.               tool->vrfxthree = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTHREE_GADGET,  -1,  0);
  2395.               if ((tool->vrfxtype < 8)|(tool->vrfxtype > 11))
  2396.                   {
  2397.                   MS = 0;
  2398.                   LS = tool->vrfxthree;
  2399.                   }
  2400.               if (tool->vrfxtype == 8)
  2401.                   {
  2402.                   MS = tool->vrfxthree;
  2403.                   LS = 0x08;
  2404.                   }
  2405.               if (tool->vrfxtype == 9)
  2406.                   {
  2407.                   MS = tool->vrfxthree;
  2408.                   LS = 0x28;
  2409.                   }
  2410.               if (tool->vrfxtype == 10)
  2411.                   {
  2412.                   MS = tool->vrfxthree;
  2413.                   LS = 0x74;
  2414.                   }
  2415.               if (tool->vrfxtype == 11)
  2416.                   {
  2417.                   MS = 0;
  2418.                   LS = tool->vrfxthree;
  2419.                   }
  2420.               sprintf(tool->storage4, "F043104C020146%02lx%02lxF7",MS,LS);
  2421.               tool->threesysex = tool->storage4;
  2422.               transsysex(tool,  time,  tool->threesysex,1);
  2423.               break;
  2424.             case VXTHREEUP_GADGET:
  2425.               tool->vrfxthree = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTHREE_GADGET,  1,  0);
  2426.               if ((tool->vrfxtype < 8)|(tool->vrfxtype > 11))
  2427.                   {
  2428.                   MS = 0;
  2429.                   LS = tool->vrfxthree;
  2430.                   }
  2431.               if (tool->vrfxtype == 8)
  2432.                   {
  2433.                   MS = tool->vrfxthree;
  2434.                   LS = 0x08;
  2435.                   }
  2436.               if (tool->vrfxtype == 9)
  2437.                   {
  2438.                   MS = tool->vrfxthree;
  2439.                   LS = 0x28;
  2440.                   }
  2441.               if (tool->vrfxtype == 10)
  2442.                   {
  2443.                   MS = tool->vrfxthree;
  2444.                   LS = 0x74;
  2445.                   }
  2446.               if (tool->vrfxtype == 11)
  2447.                   {
  2448.                   MS = 0;
  2449.                   LS = tool->vrfxthree;
  2450.                   }
  2451.               sprintf(tool->storage4, "F043104C020146%02lx%02lxF7",MS,LS);
  2452.               tool->threesysex = tool->storage4;
  2453.               transsysex(tool,  time,  tool->threesysex,1);
  2454.               break;
  2455.             case VXFOUR_GADGET:
  2456.               tool->vrfxfour = (UBYTE) (*functions->DragEmbossedProp)(window,  VXFOUR_GADGET);
  2457.               if ((tool->vrfxtype < 8)|(tool->vrfxtype > 11))
  2458.                   {
  2459.                   MS = 0;
  2460.                   LS = tool->vrfxfour;
  2461.                   }
  2462.               if (tool->vrfxtype == 8)
  2463.                   {
  2464.                   MS = tool->vrfxfour;
  2465.                   LS = 0x08;
  2466.                   }
  2467.               if (tool->vrfxtype == 9)
  2468.                   {
  2469.                   MS = tool->vrfxfour;
  2470.                   LS = 0x26;
  2471.                   }
  2472.               if (tool->vrfxtype == 10)
  2473.                   {
  2474.                   MS = 0;
  2475.                   LS = tool->vrfxfour;
  2476.                   }
  2477.               if (tool->vrfxtype == 11)
  2478.                   {
  2479.                   MS = 0;
  2480.                   LS = tool->vrfxfour;
  2481.                   }
  2482.               sprintf(tool->storage5, "F043104C020148%02lx%02lxF7",MS,LS);
  2483.               tool->foursysex = tool->storage5;
  2484.               transsysex(tool,  time,  tool->foursysex,1);
  2485.               break;
  2486.             case VXFOURDOWN_GADGET:
  2487.               tool->vrfxfour = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXFOUR_GADGET,  -1,  0);
  2488.               if ((tool->vrfxtype < 8)|(tool->vrfxtype > 11))
  2489.                   {
  2490.                   MS = 0;
  2491.                   LS = tool->vrfxfour;
  2492.                   }
  2493.               if (tool->vrfxtype == 8)
  2494.                   {
  2495.                   MS = tool->vrfxfour;
  2496.                   LS = 0x08;
  2497.                   }
  2498.               if (tool->vrfxtype == 9)
  2499.                   {
  2500.                   MS = tool->vrfxfour;
  2501.                   LS = 0x26;
  2502.                   }
  2503.               if (tool->vrfxtype == 10)
  2504.                   {
  2505.                   MS = 0;
  2506.                   LS = tool->vrfxfour;
  2507.                   }
  2508.               if (tool->vrfxtype == 11)
  2509.                   {
  2510.                   MS = 0;
  2511.                   LS = tool->vrfxfour;
  2512.                   }
  2513.               sprintf(tool->storage5, "F043104C020148%02lx%02lxF7",MS,LS);
  2514.               tool->foursysex = tool->storage5;
  2515.               transsysex(tool,  time,  tool->foursysex,1);
  2516.               break;
  2517.             case VXFOURUP_GADGET:
  2518.               tool->vrfxfour = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXFOUR_GADGET,  1,  0);
  2519.               if ((tool->vrfxtype < 8)|(tool->vrfxtype > 11))
  2520.                   {
  2521.                   MS = 0;
  2522.                   LS = tool->vrfxfour;
  2523.                   }
  2524.               if (tool->vrfxtype == 8)
  2525.                   {
  2526.                   MS = tool->vrfxfour;
  2527.                   LS = 0x08;
  2528.                   }
  2529.               if (tool->vrfxtype == 9)
  2530.                   {
  2531.                   MS = tool->vrfxfour;
  2532.                   LS = 0x26;
  2533.                   }
  2534.               if (tool->vrfxtype == 10)
  2535.                   {
  2536.                   MS = 0;
  2537.                   LS = tool->vrfxfour;
  2538.                   }
  2539.               if (tool->vrfxtype == 11)
  2540.                   {
  2541.                   MS = 0;
  2542.                   LS = tool->vrfxfour;
  2543.                   }
  2544.               sprintf(tool->storage5, "F043104C020148%02lx%02lxF7",MS,LS);
  2545.               tool->foursysex = tool->storage5;
  2546.               transsysex(tool,  time,  tool->foursysex,1);
  2547.               break;
  2548.             case VXFIVE_GADGET:
  2549.               tool->vrfxfive = (UBYTE) (*functions->DragEmbossedProp)(window,  VXFIVE_GADGET);
  2550.               sprintf(tool->storage6, "F043104C02014a00%02lxF7", tool->vrfxfive);
  2551.               tool->fivesysex = tool->storage6;
  2552.               transsysex(tool,  time,  tool->fivesysex,1);
  2553.               break;
  2554.             case VXFIVEDOWN_GADGET:
  2555.               tool->vrfxfive = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXFIVE_GADGET,  -1,  0);
  2556.               sprintf(tool->storage6, "F043104C02014a00%02lxF7",tool->vrfxfive);
  2557.               tool->fivesysex = tool->storage6;
  2558.               transsysex(tool,  time,  tool->fivesysex,1);
  2559.               break;
  2560.             case VXFIVEUP_GADGET:
  2561.               tool->vrfxfive = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXFIVE_GADGET,  1,  0);
  2562.               sprintf(tool->storage6, "F043104C02014a00%02lxF7",tool->vrfxfive);
  2563.               tool->fivesysex = tool->storage6;
  2564.               transsysex(tool,  time,  tool->fivesysex,1);
  2565.               break;
  2566.             case VXSIX_GADGET:
  2567.               tool->vrfxsix = (UBYTE) (*functions->DragEmbossedProp)(window,  VXSIX_GADGET);
  2568.               if (tool->vrfxtype == 10)
  2569.                   {
  2570.                   MS = tool->vrfxsix;
  2571.                   LS = 0x24;
  2572.                   }
  2573.               else if (tool->vrfxtype == 11)
  2574.                   {
  2575.                   MS = tool->vrfxsix;
  2576.                   LS = 0x20;
  2577.                   }
  2578.               else
  2579.                   {
  2580.                   MS = 0x00;
  2581.                   LS = tool->vrfxsix;
  2582.                   }
  2583.               sprintf(tool->storage7, "F043104C02014c%02lx%02lxF7",MS,LS);
  2584.               tool->sixsysex = tool->storage7;
  2585.               transsysex(tool,  time,  tool->sixsysex,1);
  2586.               break;
  2587.             case VXSIXDOWN_GADGET:
  2588.               tool->vrfxsix = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXSIX_GADGET,  -1,  0);
  2589.               if (tool->vrfxtype == 10)
  2590.                   {
  2591.                   MS = tool->vrfxsix;
  2592.                   LS = 0x24;
  2593.                   }
  2594.               else if (tool->vrfxtype == 11)
  2595.                   {
  2596.                   MS = tool->vrfxsix;
  2597.                   LS = 0x20;
  2598.                   }
  2599.               else
  2600.                   {
  2601.                   MS = 0x00;
  2602.                   LS = tool->vrfxsix;
  2603.                   }
  2604.               sprintf(tool->storage7, "F043104C02014c%02lx%02lxF7",MS,LS);
  2605.               tool->sixsysex = tool->storage7;
  2606.               transsysex(tool,  time,  tool->sixsysex,1);
  2607.               break;
  2608.             case VXSIXUP_GADGET:
  2609.               tool->vrfxsix = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXSIX_GADGET,  1,  0);
  2610.               if (tool->vrfxtype == 10)
  2611.                   {
  2612.                   MS = tool->vrfxsix;
  2613.                   LS = 0x24;
  2614.                   }
  2615.               else if (tool->vrfxtype == 11)
  2616.                   {
  2617.                   MS = tool->vrfxsix;
  2618.                   LS = 0x20;
  2619.                   }
  2620.               else
  2621.                   {
  2622.                   MS = 0x00;
  2623.                   LS = tool->vrfxsix;
  2624.                   }
  2625.               sprintf(tool->storage7, "F043104C02014c%02lx%02lxF7",MS,LS);
  2626.               tool->sixsysex = tool->storage7;
  2627.               transsysex(tool,  time,  tool->sixsysex,1);
  2628.               break;
  2629.             case VXSEVEN_GADGET:
  2630.               tool->vrfxseven = (UBYTE) (*functions->DragEmbossedProp)(window,  VXSEVEN_GADGET);
  2631.               if (tool->vrfxtype == 8)
  2632.                   {
  2633.                   MS = 0;
  2634.                   LS = tool->vrfxseven;
  2635.                   }
  2636.               else if (tool->vrfxtype == 10)
  2637.                   {
  2638.                   MS = tool->vrfxseven;
  2639.                   LS = 0x74;
  2640.                   }
  2641.               else
  2642.                   {
  2643.                   MS = 0;
  2644.                   LS = tool->vrfxseven;
  2645.                   }
  2646.               sprintf(tool->storage8, "F043104C02014e%02lx%02lxF7",MS,LS);
  2647.               tool->sevensysex = tool->storage8;
  2648.               transsysex(tool,  time,  tool->sevensysex,1);
  2649.               break;
  2650.             case VXSEVENDOWN_GADGET:
  2651.               tool->vrfxseven = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXSEVEN_GADGET,  -1,  0);
  2652.               if (tool->vrfxtype == 8)
  2653.                   {
  2654.                   MS = 0;
  2655.                   LS = tool->vrfxseven;
  2656.                   }
  2657.               else if (tool->vrfxtype == 10)
  2658.                   {
  2659.                   MS = tool->vrfxseven;
  2660.                   LS = 0x74;
  2661.                   }
  2662.               else
  2663.                   {
  2664.                   MS = 0;
  2665.                   LS = tool->vrfxseven;
  2666.                   }
  2667.               sprintf(tool->storage8, "F043104C02014e%02lx%02lxF7",MS,LS);
  2668.               tool->sevensysex = tool->storage8;
  2669.               transsysex(tool,  time,  tool->sevensysex,1);
  2670.               break;
  2671.             case VXSEVENUP_GADGET:
  2672.               tool->vrfxseven = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXSEVEN_GADGET,  1,  0);
  2673.               if (tool->vrfxtype == 8)
  2674.                   {
  2675.                   MS = 0;
  2676.                   LS = tool->vrfxseven;
  2677.                   }
  2678.               else if (tool->vrfxtype == 10)
  2679.                   {
  2680.                   MS = tool->vrfxseven;
  2681.                   LS = 0x74;
  2682.                   }
  2683.               else
  2684.                   {
  2685.                   MS = 0;
  2686.                   LS = tool->vrfxseven;
  2687.                   }
  2688.               sprintf(tool->storage8, "F043104C02014e%02lx%02lxF7",MS,LS);
  2689.               tool->sevensysex = tool->storage8;
  2690.               transsysex(tool,  time,  tool->sevensysex,1);
  2691.               break;
  2692.             case VXEIGHT_GADGET:
  2693.               tool->vrfxeight = (UBYTE) (*functions->DragEmbossedProp)(window,  VXEIGHT_GADGET);
  2694.               if (tool->vrfxtype == 10)
  2695.                   {
  2696.                   MS = tool->vrfxeight;
  2697.                   LS = 0x74;
  2698.                   }
  2699.               else
  2700.                   {
  2701.                   MS = 0;
  2702.                   LS = tool->vrfxeight;
  2703.                   }
  2704.               sprintf(tool->storage9, "F043104C020150%02lx%02lxF7",MS,LS);
  2705.               tool->eightsysex = tool->storage9;
  2706.               transsysex(tool,  time,  tool->eightsysex,1);
  2707.               break;
  2708.             case VXEIGHTDOWN_GADGET:
  2709.               tool->vrfxeight = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXEIGHT_GADGET,  -1,  0);
  2710.               if (tool->vrfxtype == 10)
  2711.                   {
  2712.                   MS = tool->vrfxeight;
  2713.                   LS = 0x74;
  2714.                   }
  2715.               else
  2716.                   {
  2717.                   MS = 0;
  2718.                   LS = tool->vrfxeight;
  2719.                   }
  2720.               sprintf(tool->storage9, "F043104C020150%02lx%02lxF7",MS,LS);
  2721.               tool->eightsysex = tool->storage9;
  2722.               transsysex(tool,  time,  tool->eightsysex,1);
  2723.               break;
  2724.             case VXEIGHTUP_GADGET:
  2725.               tool->vrfxeight = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXEIGHT_GADGET,  1,  0);
  2726.               if (tool->vrfxtype == 10)
  2727.                   {
  2728.                   MS = tool->vrfxeight;
  2729.                   LS = 0x74;
  2730.                   }
  2731.               else
  2732.                   {
  2733.                   MS = 0;
  2734.                   LS = tool->vrfxeight;
  2735.                   }
  2736.               sprintf(tool->storage9, "F043104C020150%02lx%02lxF7",MS,LS);
  2737.               tool->eightsysex = tool->storage9;
  2738.               transsysex(tool,  time,  tool->eightsysex,1);
  2739.               break;
  2740.             case VXNINE_GADGET:
  2741.               tool->vrfxnine = (UBYTE) (*functions->DragEmbossedProp)(window,  VXNINE_GADGET);
  2742.               sprintf(tool->storage10, "F043104C02015200%02lxF7",tool->vrfxnine);
  2743.               tool->ninesysex = tool->storage10;
  2744.               transsysex(tool,  time,  tool->ninesysex,1);
  2745.               break;
  2746.             case VXNINEDOWN_GADGET:
  2747.               tool->vrfxnine = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXNINE_GADGET,  -1,  0);
  2748.               sprintf(tool->storage10, "F043104C02015200%02lxF7",tool->vrfxnine);
  2749.               tool->ninesysex = tool->storage10;
  2750.               transsysex(tool,  time,  tool->ninesysex,1);
  2751.               break;
  2752.             case VXNINEUP_GADGET:
  2753.               tool->vrfxnine = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXNINE_GADGET,  1,  0);
  2754.               sprintf(tool->storage10, "F043104C02015200%02lxF7",tool->vrfxnine);
  2755.               tool->ninesysex = tool->storage10;
  2756.               transsysex(tool,  time,  tool->ninesysex,1);
  2757.               break;
  2758.             case VXTEN_GADGET:
  2759.               tool->vrfxten = (UBYTE) (*functions->DragEmbossedProp)(window,  VXTEN_GADGET);
  2760.               sprintf(tool->storage11, "F043104C02015400%02lxF7",tool->vrfxten);
  2761.               tool->tensysex = tool->storage11;
  2762.               transsysex(tool,  time,  tool->tensysex,1);
  2763.               break;
  2764.             case VXTENDOWN_GADGET:
  2765.               tool->vrfxten = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTEN_GADGET,  -1,  0);
  2766.               sprintf(tool->storage11, "F043104C02015400%02lxF7",tool->vrfxten);
  2767.               tool->tensysex = tool->storage11;
  2768.               transsysex(tool,  time,  tool->tensysex,1);
  2769.               break;
  2770.             case VXTENUP_GADGET:
  2771.               tool->vrfxten = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTEN_GADGET,  1,  0);
  2772.               sprintf(tool->storage11, "F043104C02015400%02lxF7",tool->vrfxten);
  2773.               tool->tensysex = tool->storage11;
  2774.               transsysex(tool,  time,  tool->tensysex,1);
  2775.               break;
  2776.             case VXELEVEN_GADGET:
  2777.               tool->vrfxeleven = (UBYTE) (*functions->DragEmbossedProp)(window,  VXELEVEN_GADGET);
  2778.               sprintf(tool->storage12, "F043104C02056C%02lxF7",tool->vrfxeleven);
  2779.               tool->elevensysex = tool->storage12;
  2780.               transsysex(tool,  time,  tool->elevensysex,1);
  2781.               break;
  2782.             case VXELEVENDOWN_GADGET:
  2783.               tool->vrfxeleven = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXELEVEN_GADGET,  -1,  0);
  2784.               sprintf(tool->storage12, "F043104C020156%02lxF7",tool->vrfxeleven);
  2785.               tool->elevensysex = tool->storage12;
  2786.               transsysex(tool,  time,  tool->elevensysex,1);
  2787.               break;
  2788.             case VXELEVENUP_GADGET:
  2789.               tool->vrfxeleven = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXELEVEN_GADGET,  1,  0);
  2790.               sprintf(tool->storage12, "F043104C020156%02lxF7",tool->vrfxeleven);
  2791.               tool->elevensysex = tool->storage12;
  2792.               transsysex(tool,  time,  tool->elevensysex,1);
  2793.               break;
  2794.             case VXTWELVE_GADGET:
  2795.               tool->vrfxtwelve = (UBYTE) (*functions->DragEmbossedProp)(window,  VXTWELVE_GADGET);
  2796.               sprintf(tool->storage13, "F043104C020157%02lxF7",tool->vrfxtwelve);
  2797.               tool->twelvesysex = tool->storage13;
  2798.               transsysex(tool,  time,  tool->twelvesysex,1);
  2799.               break;
  2800.             case VXTWELVEDOWN_GADGET:
  2801.               tool->vrfxtwelve = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTWELVE_GADGET,  -1,  0);
  2802.               sprintf(tool->storage13, "F043104C020157%02lxF7",tool->vrfxtwelve);
  2803.               tool->twelvesysex = tool->storage13;
  2804.               transsysex(tool,  time,  tool->twelvesysex,1);
  2805.               break;
  2806.             case VXTWELVEUP_GADGET:
  2807.               tool->vrfxtwelve = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTWELVE_GADGET,  1,  0);
  2808.               sprintf(tool->storage13, "F043104C020157%02lxF7",tool->vrfxtwelve);
  2809.               tool->twelvesysex = tool->storage13;
  2810.               transsysex(tool,  time,  tool->twelvesysex,1);
  2811.               break;
  2812.             case VXTHIRTEEN_GADGET:
  2813.               tool->vrfxthirteen = (UBYTE) (*functions->DragEmbossedProp)(window,  VXTHIRTEEN_GADGET);
  2814.               sprintf(tool->storage14, "F043104C020158%02lxF7",tool->vrfxthirteen);
  2815.               tool->thirteensysex = tool->storage14;
  2816.               transsysex(tool,  time,  tool->thirteensysex,1);
  2817.               break;
  2818.             case VXTHIRTEENDOWN_GADGET:
  2819.               tool->vrfxthirteen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTHIRTEEN_GADGET,  -1,  0);
  2820.               sprintf(tool->storage14, "F043104C020158%02lxF7",tool->vrfxthirteen);
  2821.               tool->thirteensysex = tool->storage14;
  2822.               transsysex(tool,  time,  tool->thirteensysex,1);
  2823.               break;
  2824.             case VXTHIRTEENUP_GADGET:
  2825.               tool->vrfxthirteen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTHIRTEEN_GADGET,  1,  0);
  2826.               sprintf(tool->storage14, "F043104C020158%02lxF7",tool->vrfxthirteen);
  2827.               tool->thirteensysex = tool->storage14;
  2828.               transsysex(tool,  time,  tool->thirteensysex,1);
  2829.               break;
  2830.             case VXFOURTEEN_GADGET:
  2831.               tool->vrfxfourteen = (UBYTE) (*functions->DragEmbossedProp)(window,  VXFOURTEEN_GADGET);
  2832.               sprintf(tool->storage15, "F043104C020159%02lxF7",tool->vrfxfourteen);
  2833.               tool->fourteensysex = tool->storage15;
  2834.               transsysex(tool,  time,  tool->fourteensysex,1);
  2835.               break;
  2836.             case VXFOURTEENDOWN_GADGET:
  2837.               tool->vrfxthirteen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXFOURTEEN_GADGET,  -1,  0);
  2838.               sprintf(tool->storage15, "F043104C020159%02lxF7",tool->vrfxfourteen);
  2839.               tool->fourteensysex = tool->storage15;
  2840.               transsysex(tool,  time,  tool->fourteensysex,1);
  2841.               break;
  2842.             case VXFOURTEENUP_GADGET:
  2843.               tool->vrfxthirteen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXFOURTEEN_GADGET,  1,  0);
  2844.               sprintf(tool->storage15, "F043104C020159%02lxF7",tool->vrfxfourteen);
  2845.               tool->fourteensysex = tool->storage15;
  2846.               transsysex(tool,  time,  tool->fourteensysex,1);
  2847.               break;
  2848.             case VXFIFTEEN_GADGET:
  2849.               tool->vrfxfifteen = (UBYTE) (*functions->DragEmbossedProp)(window,  VXFIFTEEN_GADGET);
  2850.               sprintf(tool->storage16, "F043104C020170%02lxF7",tool->vrfxfifteen);
  2851.               tool->fifteensysex = tool->storage16;
  2852.               transsysex(tool,  time,  tool->fifteensysex,1);
  2853.               break;
  2854.             case VXFIFTEENDOWN_GADGET:
  2855.               tool->vrfxfifteen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXFIFTEEN_GADGET,  -1,  0);
  2856.               sprintf(tool->storage16, "F043104C020170%02lxF7",tool->vrfxfifteen);
  2857.               tool->fifteensysex = tool->storage16;
  2858.               transsysex(tool,  time,  tool->fifteensysex,1);
  2859.               break;
  2860.             case VXFIFTEENUP_GADGET:
  2861.               tool->vrfxfifteen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXFIFTEEN_GADGET,  1,  0);
  2862.               sprintf(tool->storage16, "F043104C020170%02lxF7",tool->vrfxfifteen);
  2863.               tool->fifteensysex = tool->storage16;
  2864.               transsysex(tool,  time,  tool->fifteensysex,1);
  2865.               break;
  2866.             case VXSIXTEEN_GADGET:
  2867.               tool->vrfxsixteen = (UBYTE) (*functions->DragEmbossedProp)(window,  VXSIXTEEN_GADGET);
  2868.               sprintf(tool->storage17, "F043104C020171%02lxF7",tool->vrfxsixteen);
  2869.               tool->sixteensysex = tool->storage17;
  2870.               transsysex(tool,  time,  tool->sixteensysex,1);
  2871.               break;
  2872.             case VXSIXTEENDOWN_GADGET:
  2873.               tool->vrfxsixteen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXSIXTEEN_GADGET,  -1,  0);
  2874.               sprintf(tool->storage17, "F043104C020171%02lxF7",tool->vrfxsixteen);
  2875.               tool->sixteensysex = tool->storage17;
  2876.               transsysex(tool,  time,  tool->sixteensysex,1);
  2877.               break;
  2878.             case VXSIXTEENUP_GADGET:
  2879.               tool->vrfxsixteen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXSIXTEEN_GADGET,  1,  0);
  2880.               sprintf(tool->storage17, "F043104C020171%02lxF7",tool->vrfxsixteen);
  2881.               tool->sixteensysex = tool->storage17;
  2882.               transsysex(tool,  time,  tool->sixteensysex,1);
  2883.               break;
  2884.             case VXSEVENTEEN_GADGET:
  2885.               tool->vrfxseventeen = (UBYTE) (*functions->DragEmbossedProp)(window,  VXSEVENTEEN_GADGET);
  2886.               sprintf(tool->storage18, "F043104C020172%02lxF7",tool->vrfxseventeen);
  2887.               tool->seventeensysex = tool->storage18;
  2888.               transsysex(tool,  time,  tool->seventeensysex,1);
  2889.               break;
  2890.             case VXSEVENTEENDOWN_GADGET:
  2891.               tool->vrfxseventeen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXSEVENTEEN_GADGET,  -1,  0);
  2892.               sprintf(tool->storage18, "F043104C020172%02lxF7",tool->vrfxseventeen);
  2893.               tool->seventeensysex = tool->storage18;
  2894.               transsysex(tool,  time,  tool->seventeensysex,1);
  2895.               break;
  2896.             case VXSEVENTEENUP_GADGET:
  2897.               tool->vrfxseventeen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXSEVENTEEN_GADGET,  1,  0);
  2898.               sprintf(tool->storage18, "F043104C020172%02lxF7",tool->vrfxseventeen);
  2899.               tool->seventeensysex = tool->storage18;
  2900.               transsysex(tool,  time,  tool->seventeensysex,1);
  2901.               break;
  2902.             case VXEIGHTEEN_GADGET:
  2903.               tool->vrfxeighteen = (UBYTE) (*functions->DragEmbossedProp)(window,  VXEIGHTEEN_GADGET);
  2904.               sprintf(tool->storage19, "F043104C020173%02lxF7",tool->vrfxeighteen);
  2905.               tool->eighteensysex = tool->storage19;
  2906.               transsysex(tool,  time,  tool->eighteensysex,1);
  2907.               break;
  2908.             case VXEIGHTEENDOWN_GADGET:
  2909.               tool->vrfxeighteen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXEIGHTEEN_GADGET,  -1,  0);
  2910.               sprintf(tool->storage19, "F043104C020173%02lxF7",tool->vrfxeighteen);
  2911.               tool->eighteensysex = tool->storage19;
  2912.               transsysex(tool,  time,  tool->eighteensysex,1);
  2913.               break;
  2914.             case VXEIGHTEENUP_GADGET:
  2915.               tool->vrfxeighteen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXEIGHTEEN_GADGET,  1,  0);
  2916.               sprintf(tool->storage19, "F043104C020173%02lxF7",tool->vrfxeighteen);
  2917.               tool->eighteensysex = tool->storage19;
  2918.               transsysex(tool,  time,  tool->eighteensysex,1);
  2919.               break;
  2920.             case VXNINETEEN_GADGET:
  2921.               tool->vrfxnineteen = (UBYTE) (*functions->DragEmbossedProp)(window,  VXNINETEEN_GADGET);
  2922.               sprintf(tool->storage20, "F043104C020174%02lxF7",tool->vrfxnineteen);
  2923.               tool->nineteensysex = tool->storage20;
  2924.               transsysex(tool,  time,  tool->nineteensysex,1);
  2925.               break;
  2926.             case VXNINETEENDOWN_GADGET:
  2927.               tool->vrfxnineteen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXNINETEEN_GADGET,  -1,  0);
  2928.               sprintf(tool->storage20, "F043104C020174%02lxF7",tool->vrfxnineteen);
  2929.               tool->nineteensysex = tool->storage20;
  2930.               transsysex(tool,  time,  tool->nineteensysex,1);
  2931.               break;
  2932.             case VXNINETEENUP_GADGET:
  2933.               tool->vrfxnineteen = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXNINETEEN_GADGET,  1,  0);
  2934.               sprintf(tool->storage20, "F043104C020174%02lxF7",tool->vrfxnineteen);
  2935.               tool->nineteensysex = tool->storage20;
  2936.               transsysex(tool,  time,  tool->nineteensysex,1);
  2937.               break;
  2938.             case VXTWENTY_GADGET:
  2939.               tool->vrfxtwenty = (UBYTE) (*functions->DragEmbossedProp)(window,  VXTWENTY_GADGET);
  2940.               sprintf(tool->storage21, "F043104C020175%02lxF7",tool->vrfxtwenty);
  2941.               tool->twentysysex = tool->storage21;
  2942.               transsysex(tool,  time,  tool->twentysysex,1);
  2943.               break;
  2944.             case VXTWENTYDOWN_GADGET:
  2945.               tool->vrfxtwenty = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTWENTY_GADGET,  -1,  0);
  2946.               sprintf(tool->storage21, "F043104C020175%02lxF7",tool->vrfxtwenty);
  2947.               tool->twentysysex = tool->storage21;
  2948.               transsysex(tool,  time,  tool->twentysysex,1);
  2949.               break;
  2950.             case VXTWENTYUP_GADGET:
  2951.               tool->vrfxtwenty = (UBYTE) (*functions->ShiftEmbossedProp)(window,  VXTWENTY_GADGET,  1,  0);
  2952.               sprintf(tool->storage21, "F043104C020175%02lxF7",tool->vrfxtwenty);
  2953.               tool->twentysysex = tool->storage21;
  2954.               transsysex(tool,  time,  tool->twentysysex,1);
  2955.               break;
  2956.             case WRITE_GADGET:
  2957.               if ((*functions->areyousure)("write to track ? Play-pointer on right place ?"))
  2958.                   {
  2959.                   if (!functions->running)
  2960.                       {
  2961.                       time = functions->starttime;
  2962.                       if (tool->typesysex != NULL) transsysex(tool, time, tool->typesysex, 0);
  2963.                       if (tool->onesysex != NULL)transsysex(tool, time+1, tool->onesysex, 0);
  2964.                       if (tool->twosysex != NULL)transsysex(tool, time+2, tool->twosysex, 0);
  2965.                       if (tool->threesysex != NULL)transsysex(tool, time+3, tool->threesysex, 0);
  2966.                       if (tool->foursysex != NULL)transsysex(tool, time+4, tool->foursysex, 0);
  2967.                       if (tool->fivesysex != NULL)transsysex(tool, time+5, tool->fivesysex, 0);
  2968.                       if (tool->sixsysex != NULL)transsysex(tool, time+6, tool->sixsysex, 0);
  2969.                       if (tool->sevensysex != NULL)transsysex(tool, time+7, tool->sevensysex, 0);
  2970.                       if (tool->eightsysex != NULL)transsysex(tool, time+9, tool->eightsysex, 0);
  2971.                       if (tool->ninesysex != NULL)transsysex(tool, time+10, tool->ninesysex, 0);
  2972.                       if (tool->tensysex != NULL)transsysex(tool, time+11, tool->tensysex, 0);
  2973.                       if (tool->elevensysex != NULL)transsysex(tool, time+12, tool->elevensysex, 0);
  2974.                       if (tool->twelvesysex != NULL)transsysex(tool, time+13, tool->twelvesysex, 0);
  2975.                       if (tool->thirteensysex != NULL)transsysex(tool, time+14, tool->thirteensysex, 0);
  2976.                       if (tool->fourteensysex != NULL)transsysex(tool, time+15, tool->fourteensysex, 0);
  2977.                       if (tool->fifteensysex != NULL)transsysex(tool, time+16, tool->fifteensysex, 0);
  2978.                       if (tool->sixteensysex != NULL)transsysex(tool, time+17, tool->sixteensysex, 0);
  2979.                       if (tool->seventeensysex != NULL)transsysex(tool, time+18, tool->seventeensysex, 0);
  2980.                       if (tool->eighteensysex != NULL)transsysex(tool, time+19, tool->eighteensysex, 0);
  2981.                       if (tool->nineteensysex != NULL)transsysex(tool, time+20, tool->nineteensysex, 0);
  2982.                       if (tool->twentysysex != NULL)transsysex(tool, time+21, tool->twentysysex, 0);
  2983.                       }
  2984.                   }
  2985.               else {
  2986.                    // nothing
  2987.                    }
  2988.               break;
  2989.             }
  2990.         send_note(tool,  functions->timenow,  60);
  2991.         }
  2992.       else if (class == GADGETUP)
  2993.         {
  2994.           // Nothing.
  2995.         }
  2996.     }
  2997.   tool->tool.window = 0;
  2998.   tool->tool.left = window->LeftEdge;
  2999.   tool->tool.top = window->TopEdge;
  3000.   tool->tool.width = window->Width;
  3001.   tool->tool.height = window->Height;
  3002.   tool->tool.touched = TOUCH_INIT | TOUCH_EDIT;
  3003.  
  3004.     for  (i = VXONE_GADGET; i <= VXTWENTY_GADGET; i +=3)
  3005.         {
  3006.           (*functions->FatEmbossedPropOff)(window,  i,  i+1, i+2);
  3007.         }
  3008.   (*functions->EmbossOff)(window,  WRITE_GADGET);
  3009.  
  3010.   (*functions->EmbossWindowOff)(window);
  3011.   (*functions->FlashyCloseWindow)(window);
  3012.   (*functions->DeleteNewWindow)(newwindow);
  3013. }
  3014.  
  3015. //to leave the tool correct
  3016.  
  3017. void __saveds removetool()
  3018. {
  3019. FreeVec(VXXG);
  3020. }
  3021.  
  3022. //start of the tool
  3023.  
  3024. struct ToolMaster *
  3025. inittoolmaster()
  3026. {
  3027.   if (!(VXXG=(UWORD *)AllocVec(sizeof (VXXGdata), MEMF_CHIP|MEMF_CLEAR))) return(NULL);
  3028.   CopyMem(&VXXGdata, VXXG,  sizeof (VXXGdata));
  3029.  
  3030.   memset((char *)&master, 0, sizeof(struct ToolMaster));
  3031.   VXXG_image.ImageData = VXXG;
  3032.   master.toolid = VXXG_ID;
  3033.   master.image = &VXXG_image;
  3034.   strcpy(master.name,  VXXG_NAME);
  3035.   master.edittool = edittoolcode;
  3036.   master.processevent = processeventcode;
  3037.   master.tooltype = VXXG_TYPE;
  3038.   master.toolsize = sizeof(struct VXXGTool);
  3039.   master.removetool = removetool;
  3040.   return(&master);
  3041. }
  3042.